3.3 KiB
Kafka + Quarkus + Docker : Demonstration
A small university project to discover the Quarkus Framework combined with the Kafka library, the whole compatible with Docker.
Run
You can run the project very simply with either Intellij IDEA, or directly within a terminal.
Intellij IDEA
Simply clone and load the project into the IDE and in the
run configurations,
choose compose
.
Terminal
Alternatively, you can build and run the project manually by using gradle and launching the application with docker-compose.
gradlew build
docker compose up
Configuration
If you wish, you can modify the configuration of the docker-compose.yaml
file to fit your needs.
The container application
can be easily modified with the following environment variables :
Name | Required | Format | Default | Description |
---|---|---|---|---|
KAFKA_BOOTSTRAP_SERVERS | true | <ip>[:port] | / | The Kafka server address |
TOPIC_TEMPERATURE_CELSIUS | false | string of alphanumeric characters, ".", "_" and "-" | temperature-celsius | The name of the Kafka topic for the temperature in Celsius |
TOPIC_TEMPERATURE_FAHRENHEIT | false | string of alphanumeric characters, ".", "_" and "-" | temperature-fahrenheit | The name of the Kafka topic for the temperature in Fahrenheit |
TEMPERATURE_LOCATION | true | <latitude>, <longitude> | 49.9, 2.3 (Amiens, France) | The coordinates where to get the temperatures from |
Expectation
The application
container shall print the current temperature at the selected place in Fahrenheit every minute.
You can also access this value with the REST api at the http://localhost:8080/temperature
endpoint.
References
The project use the Open-Meteo API to fetch the current temperature at the given location.