Confluent's Kafka Python Client
OTHER License
Bot releases are visible (Hide)
Published by rnpridgeon about 6 years ago
v0.11.5 is a feature release that adds support for the Kafka Admin API (KIP-4).
This release adds support for the Admin API, enabling applications and users to perform administrative Kafka tasks programmatically:
The API closely follows the Java Admin API:
def example_create_topics(a, topics):
new_topics = [NewTopic(topic, num_partitions=3, replication_factor=1) for topic in topics]
# Call create_topics to asynchronously create topics
fs = a.create_topics(new_topics)
# Wait for operation to finish.
for topic, f in fs.items():
try:
f.result() # The result itself is None
print("Topic {} created".format(topic))
except Exception as e:
print("Failed to create topic {}: {}".format(topic, e))
Additional examples can be found in examples/adminapi
throttle_cb
(#237) (#377)test_compatibility()
should return False
not None
would return None
when unable to check compatibility (#372, @Enether)Producer.produce
documentation to use correct time unit of seconds (#384) (#385)Published by edenhill over 6 years ago
This release adds binary wheels containing all required dependencies (librdkafka, openssl, zlib, etc) for Linux and OSX.
Should these wheels not work on your platform then please file an issue outlining what is failing, and then use the previous method of installing librdkafka manually followed by pip install --no-binary all confluent-kafka
Support for Kafka message headers has been added (requires broker version >= v0.11.0).
When producing messages simply provide a list of key,value tuples as headers=
:
myproducer.produce(topic, 'A message payload', headers=[('hdr1', 'val1'), ('another', 'one'), ('hdr1', 'duplicates are supported and ordering is retained')])
Message headers are returned as a list of tuples for consumed messages:
msg = myconsumer.poll(1)
if msg is not None and not msg.error():
headers = msg.headers()
if headers is not None:
# convert to dict, collapsing duplicate header keys
headers_dict = dict(headers)
logger
kwarg in constructors) (#148)__version__
to __init__.py
(@mrocklin)async
kwargs to asynchronous
(async
will continue working until the 1.0 API bump)Published by edenhill about 7 years ago
This is a minimal librdkafka version-synchronized release of the Python client.
Changes:
Published by ewencp over 7 years ago
Published by edenhill almost 8 years ago
Published by edenhill over 8 years ago
Bugfix release: