Sets up kafka-python with Apache Kafka on Heroku
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE
README.md Put more details in README Sep 19, 2016
kafka_helper.py
requirements.txt Remove self-requirement Sep 17, 2016
setup.cfg
setup.py Support Python 3 Mar 15, 2017

README.md

kafka_helper

kafka_helper makes it easy to use the kafka-python library with Apache Kafka on Heroku. It takes care of parsing the Kafka config vars and establishing an SSL context.

Installation

pip install kafka-helper

Usage

import kafka_helper

To get a producer and write some values to a topic:

producer = kafka_helper.get_kafka_producer()
producer.send('my-topic', key='my key', value={'k': 'v'})

To get a consumer of a topic and iterate over its stream:

consumer = kafka_helper.get_kafka_consumer(topic='my-topic')
for message in consumer:
    print message