Created
November 16, 2021 17:06
-
-
Save peterkowalski/00fff04b65bd6ef8d81c6805cf1612c4 to your computer and use it in GitHub Desktop.
[kcat usage with authentication] How to use kcat as producer / consumer and provide credentials #kafka #aws
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Metadata listing mode | |
kcat -L \ | |
-b $KAFKA_BROKER:9096 \ | |
-X security.protocol=SASL_SSL \ | |
-X sasl.mechanisms=SCRAM-SHA-512 \ | |
-X sasl.username=$USERNAME \ | |
-X sasl.password=$PASSWORD | |
# Producer mode | |
kcat -t $KAFKA_TOPIC -P \ | |
-b $KAFKA_BROKER:9096 \ | |
-X security.protocol=SASL_SSL \ | |
-X sasl.mechanisms=SCRAM-SHA-512 \ | |
-X sasl.username=$USERNAME \ | |
-X sasl.password=$PASSWORD | |
# Consumer mode | |
kcat -t $KAFKA_TOPIC \ | |
-b $KAFKA_BROKER:9096 \ | |
-f '\nKey (%K bytes): %k\t\nValue (%S bytes): %s\n\Partition: %p\tOffset: %o\n--\n' \ | |
-X security.protocol=SASL_SSL \ | |
-X sasl.mechanisms=SCRAM-SHA-512 \ | |
-X sasl.username=$USERNAME \ | |
-X sasl.password=$PASSWORD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment