Debug Confluent Cloud using kafkacat¶
You can use the kafkacat Utility to debug Confluent Cloud deployments. You can use the kafkacat is a command line utility to test and debug Apache Kafka® deployments. It is a generic non-JVM producer and consumer for Kafka. Per the kafkacat documentation, you can think of it as a “netcat for Kafka”.
Follow these instructions to use kafkacat with Confluent Cloud.
Install kafkacat using these instructions.
Export the Confluent Cloud broker list and credentials using environment variables.
export CCLOUD_BROKERS=<broker_list> export CCLOUD_ACCESS_KEY_ID=<username> export CCLOUD_SECRET_ACCESS_KEY=<password>
Use the environment variables and the two required options (
ssl.ca.location
andapi.version.request
) to connect to Confluent Cloud:kafkacat -b ${CCLOUD_BROKERS} -L -X security.protocol=SASL_SSL -X sasl.mechanisms=PLAIN \ -X sasl.username=${CCLOUD_ACCESS_KEY_ID} -X sasl.password=${CCLOUD_SECRET_ACCESS_KEY} \ -X ssl.ca.location=/usr/local/etc/openssl/cert.pem -X api.version.request=true
The
api.version.request
option is required because Confluent Cloud runs Kafka version 0.10+. For more information about kafkacat and Apache Kafka broker version compatibility, see this document.Tip
If you get an error like
Failed to verify broker certificate: unable to get local issuer certificate
, check your kafkacat version. In kafkacat versions prior to 0.11.0, it did not fall back to the system-installed certs. For more information, see the kafkacat issue.
To learn more about specific kafkacat options, run kafkacat -h
. A useful flag is -v
, which prints useful information
when debugging.
For more information, see the kafkacat documentation.