From 1c2348320ab6a0900e66097d1724018e2ae3d89a Mon Sep 17 00:00:00 2001 From: Faraphel Date: Mon, 24 Jun 2024 10:36:06 +0200 Subject: [PATCH] fixed some old documentation and fixed typo in README --- README.md | 16 +++++++++++----- .../fr/faraphel/m1_pe_kafka/kafka/AdminUtils.kt | 1 - .../faraphel/m1_pe_kafka/kafka/PrintConsumer.kt | 3 --- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3934654..5abbdf6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,12 @@ # Kafka + Quarkus + Docker : Demonstration -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 + +[![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/) combined with the [Kafka library](https://kafka.apache.org/), the whole compatible with [Docker](https://www.docker.com/). ## Run @@ -22,7 +28,7 @@ docker compose up ``` ## Configuration -If wished, you can modify the configuration of the `docker-compose.yaml` file to fit your need. +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 : @@ -30,8 +36,8 @@ The container `application` can be easily modified with the following environmen |------------------------------|----------|-----------------------------------------------------|--------------------------------------------------------------------|---------------------------------------------------------------| | KAFKA_BOOTSTRAP_SERVERS | true | \[: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 | \, \ | 49.9, 2.3 ([Amiens, France](https://fr.wikipedia.org/wiki/Amiens)) | The coordinates were to get the temperatures from | +| 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 | \, \ | 49.9, 2.3 ([Amiens, France](https://fr.wikipedia.org/wiki/Amiens)) | The coordinates where to get the temperatures from | ## Expectation The `application` container shall print the current temperature at the selected place in diff --git a/src/main/kotlin/fr/faraphel/m1_pe_kafka/kafka/AdminUtils.kt b/src/main/kotlin/fr/faraphel/m1_pe_kafka/kafka/AdminUtils.kt index e4321ea..748013e 100644 --- a/src/main/kotlin/fr/faraphel/m1_pe_kafka/kafka/AdminUtils.kt +++ b/src/main/kotlin/fr/faraphel/m1_pe_kafka/kafka/AdminUtils.kt @@ -9,7 +9,6 @@ import java.util.* /** * A wrapper around KafkaAdminClient to simplify its configuration. - * @throws IllegalArgumentException the environment variables are not properly set. * @param server the kafka server address * @param identifier the kafka identifier for the configuration * @see Admin diff --git a/src/main/kotlin/fr/faraphel/m1_pe_kafka/kafka/PrintConsumer.kt b/src/main/kotlin/fr/faraphel/m1_pe_kafka/kafka/PrintConsumer.kt index 7e956e3..7771251 100644 --- a/src/main/kotlin/fr/faraphel/m1_pe_kafka/kafka/PrintConsumer.kt +++ b/src/main/kotlin/fr/faraphel/m1_pe_kafka/kafka/PrintConsumer.kt @@ -4,7 +4,6 @@ package fr.faraphel.m1_pe_kafka.kafka import org.apache.kafka.clients.consumer.* import org.apache.kafka.common.serialization.DoubleDeserializer import org.apache.kafka.common.serialization.StringDeserializer -import java.time.DateTimeException import java.time.Duration import java.time.Instant @@ -12,7 +11,6 @@ import java.time.ZoneId import java.time.format.DateTimeFormatter import java.util.Collections import java.util.Properties -import kotlin.time.Duration.Companion.milliseconds import kotlin.time.Duration.Companion.seconds import kotlin.time.toJavaDuration @@ -22,7 +20,6 @@ import kotlin.time.toJavaDuration * @param server the kafka server address * @param topic the topic to get the records from * @param identifier the kafka identifier for the configuration - * @throws IllegalArgumentException the environment variables are not properly set. */ class PrintConsumer( private val server: String,