Kafka Node

https://www.npmjs.com/package/kafka-node
kafka-node-hello-world

We first require kafkajs module and extract the class. We then create a topic and group ID.
It is simply to identify the group that will be consuming, and the name of a topic that we’ll be producing.

Then we instantiate it with a unique client id. For brokers let’s use localhost:9092 because that is what we’re using in our Kafka settings file.

get a producer

get a consumer

Consumers Subscribe

Consumer Run

Consumer Unsubscribe

Producer Start

Producer Send Data

Producer Stop