https://github.com/jmahmood/kafkasnake
A set of examples of how to use Heroku Kafka with Python on your local environment
https://github.com/jmahmood/kafkasnake
asyncio heroku kafka kafka-consumer kafka-producer python3 tornado tornado-websocket
Last synced: 11 months ago
JSON representation
A set of examples of how to use Heroku Kafka with Python on your local environment
- Host: GitHub
- URL: https://github.com/jmahmood/kafkasnake
- Owner: jmahmood
- Created: 2017-11-07T07:22:55.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-07T07:23:11.000Z (over 8 years ago)
- Last Synced: 2025-07-04T06:44:49.256Z (12 months ago)
- Topics: asyncio, heroku, kafka, kafka-consumer, kafka-producer, python3, tornado, tornado-websocket
- Language: Python
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Python / Kafka Examples for Heroku
---
A small set of examples that show how you can use Kafka on Heroku with Python, from your own personal dev environment.
**Examples**
`standard_consumer.py` and `standard_producer.py` both use the confluent-kafka-python library.
`asyncio_kafka_consumer.py` is a consumer built on the Python 3.5+ Asyncio library.
`asyncio_websockets_kafka_consumer.py` is built on Tornado / Asyncio / aiokafka,
and shows an example of how to do pubsub with Kafka without blocking, and how to connect it to Tornado which
handles websocket connections.
**How to Use**
I am running this on a Basic-0 Heroku plan. You need to make sure `HEROKU_STAGING_APP_NAME` is pointing to the application which contains the Kafka plugin.
If you wish to use it off of Heroku, you can play with the kafka_settings files to make changes to the connection settings.