Note: Here, 9092 is the port number of the Kafka server. 'kafka-console-producer -broker-list localhost:9092 -topic '. Step3: After knowing all the requirements, try to produce a message to a topic using the command: It is because a producer must know the id of the topic to which the data is to be written. The highlighted text represents that a ' broker-list' and a ' topic id' is required to produce a message. Note: Choose '.bat' or '.sh' as per the operating system. This will help the user to read the data from the standard inputs and write it to the Kafka topic. Step2: Type the command: ' kafka-console-producer' on the command line. Step1: Start the zookeeper as well as the kafka server. There are following steps used to launch a producer: In this section, we will learn how a producer sends messages to the Kafka topics. The role of the producer is to send or write data/messages to the Kafka topics. In order to send data to the Kafka topic, a producer is required. Next → ← prev Sending data to Kafka Topics Kafka Console Producer
0 Comments
Leave a Reply. |