# AioKafka broker for taskiq
This lirary provides you with aiokafka broker for taskiq.
Usage:
```python
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:
```python
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.
Raw data
{
"_id": null,
"home_page": "",
"name": "taskiq-aio-kafka",
"maintainer": "Taskiq team",
"docs_url": null,
"requires_python": ">=3.8.1,<4.0.0",
"maintainer_email": "taskiq@no-reply.com",
"keywords": "taskiq,tasks,distributed,async,kafka,aiokafka",
"author": "Taskiq team",
"author_email": "taskiq@no-reply.com",
"download_url": "https://files.pythonhosted.org/packages/73/de/e3b8d9e6eaba306488aa405ca48671b51bfbe05bb43f3a5931928a2c0e3b/taskiq_aio_kafka-0.2.0.tar.gz",
"platform": null,
"description": "# AioKafka broker for taskiq\n\nThis lirary provides you with aiokafka broker for taskiq.\n\nUsage:\n```python\nfrom taskiq_aio_kafka import AioKafkaBroker\n\nbroker = AioKafkaBroker(bootstrap_servers=\"localhost\")\n\n@broker.task\nasync def test() -> None:\n print(\"The best task ever!\")\n```\n\n## Non-obvious things\n\nYou can configure kafka producer and consumer with special methods `configure_producer` and `configure_consumer`.\nExample:\n```python\nfrom taskiq_aio_kafka import AioKafkaBroker\n\nbroker = AioKafkaBroker(bootstrap_servers=\"localhost\")\n\n# configure producer, you can set any parameter from\n# base AIOKafkaProducer, except `loop` and `bootstrap_servers`\nbroker.configure_producer(request_timeout_ms=100000)\n\n# configure consumer, you can set any parameter from\n# base AIOKafkaConsumer, except `loop` and `bootstrap_servers`\nbroker.configure_consumer(group_id=\"the best group ever.\")\n```\n\n## Configuration\n\nAioKafkaBroker parameters:\n* `bootstrap_servers` - url to kafka nodes. Can be either string or list of strings.\n* `kafka_topic` - custom topic in kafka.\n* `result_backend` - custom result backend.\n* `task_id_generator` - custom task_id genertaor.\n* `kafka_admin_client` - custom `kafka` admin client.\n* `delete_topic_on_shutdown` - flag to delete topic on broker shutdown.\n",
"bugtrack_url": null,
"license": "LICENSE",
"summary": "Kafka broker for taskiq",
"version": "0.2.0",
"project_urls": null,
"split_keywords": [
"taskiq",
"tasks",
"distributed",
"async",
"kafka",
"aiokafka"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1f13658edbca218c2235e56c9c4e40187cd3dedec40d1a30369e37fa3d6437bf",
"md5": "4b7f1b0781ab299fcb016a353696ba25",
"sha256": "0ff647a46e5f4c539127369d369e7eef80c0efbc9e8e7a86f14d350c9f730723"
},
"downloads": -1,
"filename": "taskiq_aio_kafka-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4b7f1b0781ab299fcb016a353696ba25",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8.1,<4.0.0",
"size": 6347,
"upload_time": "2023-06-11T13:12:59",
"upload_time_iso_8601": "2023-06-11T13:12:59.006483Z",
"url": "https://files.pythonhosted.org/packages/1f/13/658edbca218c2235e56c9c4e40187cd3dedec40d1a30369e37fa3d6437bf/taskiq_aio_kafka-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "73dee3b8d9e6eaba306488aa405ca48671b51bfbe05bb43f3a5931928a2c0e3b",
"md5": "678772f855e0c8fbbeb1be98d8dd8323",
"sha256": "264b2daee23adb33fc875f378138108b7406f4891ad1ebdab7fdcb22884fb136"
},
"downloads": -1,
"filename": "taskiq_aio_kafka-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "678772f855e0c8fbbeb1be98d8dd8323",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8.1,<4.0.0",
"size": 5440,
"upload_time": "2023-06-11T13:13:00",
"upload_time_iso_8601": "2023-06-11T13:13:00.642432Z",
"url": "https://files.pythonhosted.org/packages/73/de/e3b8d9e6eaba306488aa405ca48671b51bfbe05bb43f3a5931928a2c0e3b/taskiq_aio_kafka-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-11 13:13:00",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "taskiq-aio-kafka"
}