A RESTful microservice using spring boot, to receive telemetry data and publish to kafka using the spring-kafka library
Go to file
2020-11-30 04:23:20 -05:00
config Initial commit 2020-11-30 04:23:20 -05:00
gradle/wrapper Initial commit 2020-11-30 04:23:20 -05:00
src Initial commit 2020-11-30 04:23:20 -05:00
.gitignore Initial commit 2020-11-30 04:23:20 -05:00
build.gradle Initial commit 2020-11-30 04:23:20 -05:00
gradle.properties Initial commit 2020-11-30 04:23:20 -05:00
gradlew Initial commit 2020-11-30 04:23:20 -05:00
gradlew.bat Initial commit 2020-11-30 04:23:20 -05:00
README.md Initial commit 2020-11-30 04:23:20 -05:00
settings.gradle Initial commit 2020-11-30 04:23:20 -05:00

Spring Kafka based Telemetry Data Receiver

The project is built on spring boot using spring kafka, to receive telemetry data on a REST endpoint and publish the same to a Kafka topic. The related blog post can be found at https://www.barrelsofdata.com/spring-boot-based-telemetry-data-receiver-api-spring-kafka-producer/

Build instructions

From the root of the project execute the below commands

  • To clear all compiled classes, build and log directories
./gradlew clean
  • To run tests
./gradlew test
  • To build jar
./gradlew bootJar
  • Build OCI compliant image
./gradlew bootBuildImage
  • All combined
./gradlew clean test bootBuildImage
  • Run from IDE
./gradlew bootRun -PjvmArgs="-D--spring.config.location=config/dev.properties"

Run native

java -jar build/libs/spring-telemetry-receiver-1.0.jar --spring.config.location=config/dev.properties

Run as docker container

docker run -itd --rm --network host --mount type=bind,source=$(pwd)/config/dev.properties,target=/application.properties,readonly -e JAVA_OPTS=-D--spring.config.location=/application.properties --name spring-telemetry-server spring-telemetry-receiver:1.0