Skip to main content

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 - custom kafka 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.2.0.tar.gz (5.4 kB view hashes)

Uploaded Source

Built Distribution

taskiq_aio_kafka-0.2.0-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page