Skip to content

Instantly share code, notes, and snippets.

@jgeek
Last active March 25, 2022 10:00
Show Gist options
  • Save jgeek/bb0603c6d4d68083d257ee15b1492f88 to your computer and use it in GitHub Desktop.
Save jgeek/bb0603c6d4d68083d257ee15b1492f88 to your computer and use it in GitHub Desktop.
Kafka notes
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=,
KafkaCat (https://github.com/edenhill/kafkacat) is an open-source alternative to using the Kafka CLI, created by Magnus Edenhill.
While KafkaCat is not used in this course, if you have any interest in trying it out, I recommend reading: https://medium.com/@coderunner/debugging-with-kafkacat-df7851d21968
kafka security file:
sec.properites
security.protocol=SASL_SSL
sasl.mechanism=SCRAM-SHA-512
sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="gse-user" password="39eb304beafb93f6a00e155bd7532f79";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment