nCodefresh / raw-kafka-producer-consumer

Sample demonstrating Raw Kafka Producer/Consumer client API's

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

There are three sub-projects here

  • json-serailizers - these are Kafka Serializers and De-serializers which convert the domain object to json and back

  • sample-raw-producer - to dispatch new "Work" units to a "workunits" kafka topic

  • sample-raw-consumer - to consume the available "Work" units from the "workunits" kafka topic

To run the project first start up the Kafka cluster

Assuming you are in the Kafka home folder, you can use the following set of commands to start a local kafka cluster

Start Zookeeper

bin/zookeeper-server-start.sh config/zookeeper.properties

Start Kafka broker:

bin/kafka-server-start.sh config/server.properties

Start up the Producer, from the root of the project

cd sample-raw-producer
../gradlew bootRun

Start up the Consumer

cd sample-raw-consumer
../gradlew bootRun

At this point some sample messages can be generated using this endpoint:

The producer should print a message on the console that the Work unit has been dispatched and the consumer should receive and process the Work unit

About

Sample demonstrating Raw Kafka Producer/Consumer client API's


Languages

Language:Java 100.0%