MyGit

v0.11.4

confluentinc/confluent-kafka-python

版本发布时间: 2018-04-03 00:32:37

confluentinc/confluent-kafka-python最新发布版本:v2.5.3(2024-09-02 22:24:36)

Simplified installation

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

Message header support

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)

Enhancements

Fixes

相关地址:原始地址 下载(tar) 下载(zip)

查看:2018-04-03发行的版本