Run the CLI Kafka Tools
- 1 Minute to read
- Print
- DarkLight
Run the CLI Kafka Tools
- 1 Minute to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Use the CLI Kafka Tools included on your Kafka binary distribution to start the console consumer. This will print the data coming from the topic on your console. Start it using the following command:
bin/kafka-console-consumer.sh --bootstrap-server="host:port" --topic mytopic --group groupId --consumer-property security.protocol=SASL_SSL --consumer-property sasl.mechanism=SCRAM-SHA-256 --consumer-property auto.offset.reset=earliest #--consumer-property auto.offset.reset=latest
Before running the command, take the following settings:
Substitute <host:port>, <mytopic>, and <groupId>.
Mapp provides you with the connection endpoint, topic name, consumer group, and credentials.Specify the value for
auto.offset.reset
(see section Configuration Properties for the Kafka Clients).
Alternatively, you can set the configuration properties in the "consumer.properties" file as follows:
#auto.offset.reset=earliest #auto.offset.reset=latest group.id=groupId security.protocol=SASL_SSL sasl.mechanism=SCRAM-SHA-256
Now use the
--consumer.config
parameter on the console consumer execution.bin/kafka-console-consumer.sh --bootstrap-server="host:port" --topic mytopic --consumer.config consumer.properties
Before running the command, substitute <host:port> and <mytopic>.
Was this article helpful?