aiokafka 0.1.0 Initial release.

37 views
Skip to first unread message

voyn...@gmail.com

unread,
Apr 15, 2016, 8:10:28 AM4/15/16
to aio-libs
Full feature driver for Apache Kafka distributed messaging system. Is compatible with Kafka 9.0+, uses Group Coordinator, introduced in this version of Kafka. 
The library is build on top of kafka-python by adding asyncio compatible client for Cluster and Broker management. API was slightly changed to be more pythonic and respect asyncio based application needs.

Simple producer example:

from aiokafka import AIOKafkaProducer
import asyncio

loop = asyncio.get_event_loop()

async def send_one():
    producer = AIOKafkaProducer(
        loop=loop, bootstrap_servers='localhost:9092')

    # Get cluster layout and topic/partition allocation
    await producer.start()

    # Produce messages
    await producer.send_and_wait("my_topic", b"Super message")

    await producer.stop()

loop.run_until_complete(send_one())

Simple consumer example:

from aiokafka import AIOKafkaConsumer
import asyncio

loop = asyncio.get_event_loop()

async def consume():
    consumer = AIOKafkaConsumer(
        "my_topic", loop=loop, bootstrap_servers='localhost:9092')
    # Get cluster layout and topic/partition allocation
    await consumer.start()

    async for msg in consumer:
        print(msg.value)

loop.run_until_complete(consume())

Please read the documentation at http://aiokafka.readthedocs.org/en/stable/ for more info. More examples can be found there too.

Project is hosted on GitHub: https://github.com/aio-libs/aiokafka. Please send bug reports and improvement requests to GitHub's bug tracker. Feedback is greatly appreciated.

Andrew Svetlov

unread,
Apr 15, 2016, 8:15:32 AM4/15/16
to voyn...@gmail.com, aio-libs

Great!


--
You received this message because you are subscribed to the Google Groups "aio-libs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aio-libs+u...@googlegroups.com.
To post to this group, send email to aio-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aio-libs/eab0f30c-fb8c-4103-9905-3484312a3249%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Thanks,
Andrew Svetlov
Reply all
Reply to author
Forward
0 new messages