A RESTful microservice using spring boot, to receive telemetry data and publish to kafka using the spring-kafka library
Go to file
2020-12-06 04:10:29 -05:00
config Fix code smells 2020-12-06 04:10:29 -05:00
gradle/wrapper Initial commit 2020-11-30 04:23:20 -05:00
src Fix code smells 2020-12-06 04:10:29 -05:00
.gitignore Initial commit 2020-11-30 04:23:20 -05:00
build.gradle Fix code smells 2020-12-06 04:10:29 -05:00
gradle.properties Fix code smells 2020-12-06 04:10:29 -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 Fix code smells 2020-12-06 04:10:29 -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 SonarQube Code Analysis
docker run -d --rm --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:community
./gradlew sonarqube

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