017. CLI. Options that are good to know. - MarkHuntDev/my-kafka-exercises GitHub Wiki
The CLI have many options, but here are the other that are most commonly used:
Producer with keys
kafka-console-producer --broker-list 127.0.0.1:9092 --topic first_topic --property parse.key=true --property key.separator=,
> key,value
> another key,another value
Consumer with keys
kafka-console-consumer --bootstrap-server 127.0.0.1:9092 --topic first_topic --from-beginning --property print.key=true --property key.separator=,