From 8bc403071e947c5aa0a5aa169ca15bf65dfaf1f1 Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Mon, 10 Jul 2023 10:35:47 +0300 Subject: [PATCH] #411 --- README.md | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8d28c3b1..8ee3c903 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ final Producer producer = ); ``` -Your [JSON](https://en.wikipedia.org/wiki/JSON), located in resources directory, should looks like this: +Your [JSON](https://en.wikipedia.org/wiki/JSON), located in resources directory, should look like this: ```json { "bootstrapServers": "localhost:9092", @@ -152,6 +152,22 @@ Your [JSON](https://en.wikipedia.org/wiki/JSON), located in resources directory, } ``` +Since version `0.5.6` you can create Producer with YAML file: +```java +final Producer producer = new KfProducer<>( + new KfYamlProducerSettings<>( + new YamlMapParams("producer.yaml") + ) +); +``` + +Your [YAML](https://en.wikipedia.org/wiki/YAML), located in resources directory, should look like this: +```yaml +bootstrap-servers: localhost:9092 +key-serializer: org.apache.kafka.common.serialization.StringSerializer +value-serializer: org.apache.kafka.common.serialization.StringSerializer +``` + To send a [message](#messages): ```java try (final Producer producer = ...) { @@ -250,6 +266,23 @@ Your [JSON](https://en.wikipedia.org/wiki/JSON), located in resources directory, } ``` +Since version `0.5.6` you can create Consumer with YAML file: +```java +final Consumer consumer = new KfConsumer<>( + new KfYamlConsumerSettings<>( + new YamlMapParams("consumer.yaml") + ) +); +``` + +Your [YAML](https://en.wikipedia.org/wiki/YAML), located in resources directory, should look like this: +```yaml +bootstrap-servers: localhost:9092 +group-id: "1" +key-deserializer: org.apache.kafka.common.serialization.StringDeserializer +value-deserializer: org.apache.kafka.common.serialization.StringDeserializer +``` + Consuming [messages](#messages): ```java try ( @@ -460,8 +493,8 @@ Under the hood XML document will looks like this: **By the version `0.3.5`, eo-kafka support only String values in FkConsumer**. -## Config API -| Kafka Property | eo-kafka API | XML/JSON tag +## Configs +| Kafka Property | eo-kafka API | XML/JSON/YAML tag |-----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------| ---------------------- | `bootstrap.servers` | [BootstrapServers](https://github.com/eo-cqrs/eo-kafka/blob/master/src/main/java/io/github/eocqrs/kafka/parameters/BootstrapServers.java) | bootstrapServers | `key.serializer` | [KeySerializer](https://github.com/eo-cqrs/eo-kafka/blob/master/src/main/java/io/github/eocqrs/kafka/parameters/KeySerializer.java) | keySerializer