kafka-python v1.0.0 Release Notes

Release Date: 2016-02-15 // about 8 years ago
  • ๐Ÿš€ This release includes significant code changes. Users of older kafka-python ๐Ÿ”– versions are encouraged to test upgrades before deploying to production as ๐Ÿ”ง some interfaces and configuration options have changed.

    ๐Ÿ‘‰ Users of SimpleConsumer / SimpleProducer / SimpleClient (formerly KafkaClient) ๐Ÿš€ from prior releases should migrate to KafkaConsumer / KafkaProducer. Low-level ๐Ÿšš APIs (Simple*) are no longer being actively maintained and will be removed in a ๐Ÿš€ future release.

    ๐Ÿ“š For comprehensive API documentation, please see python help() / docstrings, ๐Ÿ— kafka-python.readthedocs.org, or run tox -e docs from source to build ๐Ÿ“š documentation locally.

    Consumers

    • KafkaConsumer re-written to emulate the new 0.9 kafka consumer (java client) and support coordinated consumer groups (feature requires >= 0.9.0.0 brokers)

      • Methods no longer available:
      • configure [initialize a new consumer instead]
      • set_topic_partitions [use subscribe() or assign()]
      • fetch_messages [use poll() or iterator interface]
      • get_partition_offsets
      • offsets [use committed(partition)]
      • task_done [handled internally by auto-commit; or commit offsets manually]
      • Configuration changes (consistent with updated java client):
      • lots of new configuration parameters -- see docs for details
      • auto_offset_reset: previously values were 'smallest' or 'largest', now values are 'earliest' or 'latest'
      • fetch_wait_max_ms is now fetch_max_wait_ms
      • max_partition_fetch_bytes is now max_partition_fetch_bytes
      • deserializer_class is now value_deserializer and key_deserializer
      • auto_commit_enable is now enable_auto_commit
      • auto_commit_interval_messages was removed
      • socket_timeout_ms was removed
      • refresh_leader_backoff_ms was removed
    • ๐Ÿšš SimpleConsumer and MultiProcessConsumer are now deprecated and will be removed in a future release. Users are encouraged to migrate to KafkaConsumer.

    Producers

    • ๐Ÿ†• new producer class: KafkaProducer. Exposes the same interface as official java client. Async by default; returned future.get() can be called for synchronous blocking
    • ๐Ÿš€ SimpleProducer is now deprecated and will be removed in a future release. Users are encouraged to migrate to KafkaProducer.

    Clients

    • ๐Ÿ”€ synchronous KafkaClient renamed to SimpleClient. For backwards compatibility, you will get a SimpleClient via from kafka import KafkaClient. This will change in a future release.
    • All client calls use non-blocking IO under the hood.
    • โž• Add probe method check_version() to infer broker versions.

    ๐Ÿ“š Documentation

    • ๐Ÿ“š Updated README and sphinx documentation to address new classes.
    • ๐Ÿ“„ Docstring improvements to make python help() easier to use.

    Internals

    • ๐Ÿšš Old protocol stack is deprecated. It has been moved to kafka.protocol.legacy and may be removed in a future release.
    • Protocol layer re-written using Type classes, Schemas and Structs (modeled on the java client).
    • โž• Add support for LZ4 compression (including broken framing header checksum).