Kafka framework
Project description
pyafka
Pyafka is a utility to receive Kafka events in python service. It uses confluent_kafka under the hood.
To use - annotate your handler method as follows:
@kafka_consumer("broker_url", ["my_topic", "some_other_topic])
def handler(message):
print(message.value())
You can pass additional arguments to '@kafka_consumer decorator'.
1: Specify kafka consumer group (defaut group is random UUID):
@kafka_consumer("broker_url", ["my_topic", "my_other_topic], group_id="my_group_id")
def handler(message):
print(message.value())
2: Specify payload deserializer. Currently available are BytesDeserializer and StringDeserializer (default)
@kafka_consumer("broker_url", ["my_topic", "my_other_topic], deserializer=BytesDeserializer.deserialize")
def handler(message):
print(message.value())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyafka-0.2.0.tar.gz.
File metadata
- Download URL: pyafka-0.2.0.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6ee75f4aae8acf4c163eba776751149d6a40a66ea02025b5a7e6436c7fcd3a7
|
|
| MD5 |
f08390fe65662a9c79a7d9ef3bca6f97
|
|
| BLAKE2b-256 |
0e068c041a6b1111e889ec5273eee465537f9f38e0f38243007ebdcfb4262f51
|
File details
Details for the file pyafka-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pyafka-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68e8bdae44ddd30e05d21aa1465e9318e79b22e225dac15ddbd8ca612fa358f0
|
|
| MD5 |
49c824eea0f4db1fd16bfc470cdce27a
|
|
| BLAKE2b-256 |
4badc3f66aed462a525967a00002fbc36459d4061a8d92583f619a09f4075044
|