Skip to content

Spring Boot example of how to read in JSON from a Kakfa topic and, via Kafka Streams, create a single json doc from subsequent JSON documents.

Notifications You must be signed in to change notification settings

jaisinganmol/kafka-streams-spring-boot-json-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot App:

  1. Start ZooKeeper: c:\kafka> .\bin\windows\zookeeper-server-start.bat ./config\zookeeper.properties

  2. Stat Kafka: .\bin\windows\kafka-server-start.bat .\config\server.properties

  3. Create input, output topics

    kafka-topics.bat --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic streams-json-input

    kafka-topics.bat --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic streams-json-output

RUN the program

kafka-console-producer.bat --bootstrap-server localhost:9092 --topic streams-json-input

> {"key":"somekey","words":["word1"]}
> {"key":"somekey","words":["word2"]}

kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic streams-json-output --from-beginning --formatter kafka.tools.DefaultMessageFormatter --property print.key=true --property print.value=true --property print.key=true --property print.value=true > OP

About

Spring Boot example of how to read in JSON from a Kakfa topic and, via Kafka Streams, create a single json doc from subsequent JSON documents.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%