8000 GitHub - heroku/kafka-helper: Sets up kafka-python with Apache Kafka on Heroku
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/ kafka-helper Public

Sets up kafka-python with Apache Kafka on Heroku

License

Notifications You must be signed in to change notification settings

heroku/kafka-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

NOTE: The kafka_helper library is not officially supported by Heroku.

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)

About

Sets up kafka-python with Apache Kafka on Heroku

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages

0