Kafka broker for taskiq
Project description
AioKafka broker for taskiq
This lirary provides you with aiokafka broker for taskiq.
Usage:
from taskiq_aio_kafka import AioKafkaBroker
broker = AioKafkaBroker(bootstrap_servers="localhost")
@broker.task
async def test() -> None:
print("The best task ever!")
Non-obvious things
You can configure kafka producer and consumer with special methods configure_producer
and configure_consumer
.
Example:
from taskiq_aio_kafka import AioKafkaBroker
broker = AioKafkaBroker(bootstrap_servers="localhost")
# configure producer, you can set any parameter from
# base AIOKafkaProducer, except `loop` and `bootstrap_servers`
broker.configure_producer(request_timeout_ms=100000)
# configure consumer, you can set any parameter from
# base AIOKafkaConsumer, except `loop` and `bootstrap_servers`
broker.configure_consumer(group_id="the best group ever.")
Configuration
AioKafkaBroker parameters:
bootstrap_servers
- url to kafka nodes. Can be either string or list of strings.kafka_topic
- custom topic in kafka.result_backend
- custom result backend.task_id_generator
- custom task_id genertaor.kafka_admin_client
- customkafka
admin client.delete_topic_on_shutdown
- flag to delete topic on broker shutdown.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
taskiq_aio_kafka-0.1.2.tar.gz
(5.5 kB
view hashes)
Built Distribution
Close
Hashes for taskiq_aio_kafka-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9749b69cba1de41dfbf644a8102b2f83b5eb4cc1051cb2e4b5889ad2f669d3b |
|
MD5 | fa09658c4f2cc6bf8bf0758a0bd8758c |
|
BLAKE2b-256 | cf28d1d855aa56f845dc575fbecf9346d453ad1c515b18435adaf4599660cbd2 |