M1-PE-Kafka/README.md

45 lines
No EOL
3.1 KiB
Markdown

# Kafka + Quarkus + Docker : Demonstration
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[![Kotlin](https://img.shields.io/badge/kotlin-1a73e8?logo=kotlin&logoColor=white)](https://kotlinlang.org/)
[![Kafka](https://img.shields.io/badge/kafka-231F20?logo=apache-kafka&logoColor=white)](https://kafka.apache.org/)
[![Quarkus](https://img.shields.io/badge/quarkus-4695EB?logo=quarkus&logoColor=white)](https://quarkus.io/)
[![Docker](https://img.shields.io/badge/docker-2496ED?logo=docker&logoColor=white)](https://www.docker.com/)
A small university project to discover the [Quarkus Framework](https://quarkus.io/) to build the
application combined with the [Kafka platform](https://kafka.apache.org/), the whole compatible
with [Docker](https://www.docker.com/).
## Run
You can run the project very simply with either [Intellij IDEA](https://www.jetbrains.com/idea/),
or directly within a terminal.
### Intellij IDEA
Simply clone and load the project into the IDE and in the
[run configurations](https://www.jetbrains.com/help/idea/run-debug-configuration.html),
choose `compose`.
### Terminal
Alternatively, you can build and run the project manually by using
[gradle](https://gradle.org/) and launching the application with [docker-compose](https://docs.docker.com/compose/).
```shell
gradlew build
docker compose up
```
## Configuration
If wished, you can modify the configuration of the `docker-compose.yaml` file to fit your need.
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](https://fr.wikipedia.org/wiki/Amiens)) | The coordinates were to get the temperatures from |
## Expectation
The `application` container shall print the current temperature at the selected place in
Fahrenheit every minute.