Important Notice: CloudKarafka is shutting down. Read all about it in our End of Life Announcement


There are two very good client for Apache Kafka written for Python.

One is which can be installed with pip install kafka - python

And then we have the client written by Confluent, the developers of Kafka, which like all their clients are a wrapper around the excellent librdkafka

We recommend to use the client from Confluent since it supports authentication with SASL SCRAM which is what we use at CloudKaraka.

To get started, you first need all the connection variables, which you can get from the provider you used to create the CloudKarafka instance.

c = Consumer(**conf)
while True:
    msg = c.poll(timeout=1.0)
    if msg.error():
        sys.stderr.write('%% %s [%d] at offset %d with key %s:\n' %
                         (msg.topic(), msg.partition(), msg.offset(),

The complete code example, with configuration, can be found here:

I get "Failed to verify broker certificate: unable to get local issuer certificate"

Please check the answer to this issue in the FAQ: