access a kafka topic with kafka-console-consumer

Create the configuration file

Create a file consumer.properties with:

ssl.truststore.type=PEM
ssl.truststore.location=<certificat path>.crt
security.protocol=SASL_SSL
sasl.mechanism=SCRAM-SHA-512
sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="<user>" password="<password>";

Connect to the topic:

/usr/local/kafka/kafka_2.13-3.6.2/bin/kafka-console-consumer.sh --bootstrap-server <bootstrap-url> --consumer.config consumer.properties --topic <topic name>



    Enjoy Reading This Article?

    Here are some more articles you might like to read next:

  • KakfaConnect SQL Server configuration
  • KakfaConnect MariaDB configuration
  • Enable CDC for PostgreSQL
  • Enable CDC for Oracle
  • How to change Kafka SSL certificat in OpenShift (AMQ Streams)