Sunday, 3 November 2019

Kafka CLI: Add additional properties while sending messages to topic


--producer-property option is used to add additional properties to the message while publishing to a topic.
$kafka-console-producer.sh --broker-list localhost:9092 --topic myFirstTopic --producer-property acks=1
>Hey kafka,
>Leader should acknowledge about this message
>^C

Note
If you send a message to topic, which is not exist, then kafka creates the topic.



Previous                                                    Next                                                    Home

No comments:

Post a Comment