Skip to main content
https://travis-ci.com/jmf-mordis/asynckafka.svg?branch=master

Fast python Kafka client for asyncio. Asynckafka is written in Cython on top of Rdkafka as Kafka driver.

The documentation can be found here.

Features

  • Consumer using a balanced group

  • Producer

The library was born as a project to learn Cython, right now it only has the basic features implemented, some of the most important missing features are:

  • Offset management in the consumer

  • Precise partition management

Examples

Simple consumer

How to use a consumer:

consumer = Consumer(
    brokers='localhost:9092',
    topics=['my_topic'],
    group_id='my_group_id',
)
consumer.start()

async for message in consumer:
    print(f"Received message: {message.payload}")

Simple producer

How to use a producer:

producer = Producer(brokers="localhost:9092")
producer.start()
await producer.produce("my_topic", b"my_message")

Benchmark

The test was performed in June of 2018 using a single Kafka broker without replication. The purpose of the benchmark was only to have an idea of the order of magnitude of the library’s performance under these conditions.

Comparison between asynckafka and aiokafka in production and consumption:

Production
https://github.com/jmf-mordis/asynckafka/raw/master/docs/benchmark/graphs/producer.png
Consumption
https://github.com/jmf-mordis/asynckafka/raw/master/docs/benchmark/graphs/consumer.png

The benchmark used for asynckafka is in benchmark directory while the benchmark used for aiokafka is in its own repository, also in the benchmark folder.

Release files for asynckafka 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asynckafka 0.2.0
File Size Uploaded
asynckafka-0.2.0.tar.gz 421.4 kB Details

Release files / asynckafka-0.2.0.tar.gz

Download URL asynckafka-0.2.0.tar.gz
Size 421.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1716f8a96ad0384272831cf34385f0688dc542d74f26ca88dee23bab24b7f699
BLAKE2b-256 checksum
How to use checksums
648a72fb926c73a734fd43d2fae60ca0b7930809c072ded3b4659e04ae19e6fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.1

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page