Skip to content

lorenzomicheli/kotlin-spring-boot

Repository files navigation

Getting Started

The purpose of this pet project is to assess the integration between Kotlin and Spring Boot 2.

This simple service, reads a name of a person from a kafka topic and persist it on a relational database. It expose a REST endpoint to list all people saved in the database.

System and application metrics are exposed and ready to be parsed by prometheus. It also shows how to introduce custom metrics.

Logs are printed in JSON format when it's run with the spring profile "prod"

Build and Run

To run the build and tests execute:

./gradlew build

To run the application:

docker-compose up --build

Enpoints

The following HTTP endpoints are exposed:

Play Around

The application listens to the people topic on the Kafka cluster started with docker-compose. The cluster is accessible also outside Docker network at localhost:9093.

To publish a new value in the kafka topic

echo "Lorenzo" | kafkacat -b localhost:9093 -t people