Skip to content

Releases: dpkp/kafka-python

2.2.4

04 May 03:00
Compare
Choose a tag to compare

2.2.4 (May 3, 2025)

Fixes

  • Do not reset_generation after RebalanceInProgressError; improve CommitFailed error messages (#2614)
  • Fix KafkaConsumer.poll() with zero timeout (#2613)
  • Fix Fetch._reset_offsets_async() KeyError when fetching from multiple nodes (#2612)

2.1.6

02 May 17:06
Compare
Choose a tag to compare

2.1.6 (May 2, 2025)

Fixes

  • Only create fetch requests for ready nodes (#2607)

2.2.3

01 May 20:02
Compare
Choose a tag to compare

2.2.3 (May 1, 2025)

Fixes

  • Ignore leading SECURITY_PROTOCOL:// in bootstrap_servers (#2608)
  • Only create fetch requests for ready nodes (#2607)

2.2.2

01 May 20:02
Compare
Choose a tag to compare

2.2.2 (Apr 30, 2025)

Fixes

  • Fix lint errors

2.2.1

29 Apr 16:56
Compare
Choose a tag to compare

2.2.1 (Apr 29, 2025)

Fixes

  • Always try ApiVersionsRequest v0, even on broker disconnect (#2603)
  • Fix SubscriptionState AttributeError in KafkaConsumer (#2599)

Documentation

  • Add transactional examples to docs

2.2.0

28 Apr 19:11
Compare
Choose a tag to compare

2.2.0 (Apr 28, 2025)

KafkaProducer

  • KIP-98: Add idempotent producer support (#2569)
  • KIP-98: Transactional Producer (#2587)
  • KIP-98: Add offsets support to transactional KafkaProducer (#2590)
  • Prefix producer logs w/ client id and transactional id (#2591)
  • KAFKA-5429: Ignore produce response if batch was previously aborted
  • KIP-91: KafkaProducer delivery_timeout_ms
  • Default retries -> infinite
  • Expand KafkaProducer docstring w/ idempotent and transactional notes
  • RecordAccumulator: Use helper method to get/set _tp_locks; get dq with lock in reenqueue()

KafkaConsumer

  • KIP-98: Add Consumer support for READ_COMMITTED (#2582)
  • KIP-394: handle MEMBER_ID_REQUIRED error w/ second join group request (#2598)
  • KAFKA-5078: Defer fetch record exception if iterator has already moved across a valid record
  • KAFKA-5075: Defer consumer fetcher exception if fetch position has already increased
  • KAFKA-4937: Batch offset fetches in the Consumer
  • KAFKA-4547: Avoid resetting paused partitions to committed offsets
  • KAFKA-6397: Consumer should not block setting positions of unavailable partitions (#2593)

Potentially Breaking Changes (internal)

  • Rename CorruptRecordException -> CorruptRecordError
  • Rename Coordinator errors to generic not group (#2585)
  • Rename ClusterMetadata.add_group_coordinator -> add_coordinator + support txn type
  • Use SaslAuthenticationFailedError in kafka.conn connection failure; Drop unused AuthenticationFailedError
  • Remove old/unused errors; reorder; KafkaTimeout -> retriable
  • Drop log_start_offset from producer RecordMetadata

Internal

  • MemoryRecords iterator; MemoryRecordsBuilder records() helper
  • Convert DefaultRecordsBuilder.size_in_bytes to classmethod

Fixes

  • Resolve datetime deprecation warnings (#2589)
  • Avoid self refcount in log messages; test thread close on all pythons
  • Fix client.wakeup() race from producer/sender close
  • Fix ElectionNotNeededError handling in admin client

Tests

  • Move integration tests and fixtures to test/integration/; simplify unit fixtures (#2588)
  • Expand Sender test coverage (#2586)
  • py2 test fixups
  • Drop unused KafkaClient import from test_fetcher

2.1.5

07 Apr 21:44
Compare
Choose a tag to compare

2.1.5 (Apr 4, 2025)

Fixes

  • Fix python2.7 errors (#2578)

Improvements

  • Move benchmark scripts to kafka.benchmarks module (#2584)
  • Use __slots__ for metrics (#2583)
  • Pass metrics_enabled=False to disable metrics (#2581)
  • Drop unused kafka.producer.buffer / SimpleBufferPool (#2580)
  • Raise UnsupportedVersionError from coordinator (#2579)

2.1.4

28 Mar 18:04
Compare
Choose a tag to compare

2.1.4 (Mar 28, 2025)

Fixes

  • Dont block pending FetchRequests when Metadata update requested (#2576)
  • Fix MetadataRequest for no topics (#2573)
  • Send final error byte x01 on Sasl OAuth failure (#2572)
  • Reset SASL state on disconnect (#2571)
  • Try import new Sequence before old to avoid DeprecationWarning

Improvements

  • Update Makefile default to 4.0 broker; add make fixture
  • Improve connection state logging (#2574)

2.1.3

25 Mar 15:55
Compare
Choose a tag to compare

2.1.3 (Mar 25, 2025)

Fixes

  • Fix crash when switching to closest compatible api_version in KafkaClient (#2567)
  • Fix maximum version to send an OffsetFetchRequest in KafkaAdminClient (#2563)
  • Return empty set from consumer.partitions_for_topic when topic not found (#2556)

Improvements

  • KIP-511: Use ApiVersions v4 on initial connect w/ client_software_name + version (#2558)
  • KIP-74: Manage assigned partition order in consumer (#2562)
  • KIP-70: Auto-commit offsets on consumer.unsubscribe(), defer assignment changes to rejoin (#2560)
  • Use SubscriptionType to track topics/pattern/user assignment (#2565)
  • Add optional timeout_ms kwarg to consumer.close() (#2564)
  • Move ensure_valid_topic_name to kafka.util; use in client and producer (#2561)

Testing

  • Support KRaft / 4.0 brokers in tests (#2559)
  • Test older pythons against 4.0 broker

Compatibility

  • Add python 3.13 to compatibility list

2.1.2

18 Mar 05:58
Compare
Choose a tag to compare

2.1.2 (Mar 17, 2025)

Fixes

  • Simplify consumer.poll send fetches logic
  • Fix crc validation in consumer / fetcher
  • Lazy _unpack_records in PartitionRecords to fix premature fetch offset advance in consumer.poll() (#2555)
  • Debug log fetch records return; separate offsets update log
  • Fix Fetcher retriable error handling (#2554)
  • Use six.add_metaclass for py2/py3 compatible abc (#2551)

Improvements

  • Add FetchMetrics class; move topic_fetch_metrics inside aggregator
  • DefaultRecordsBatchBuilder: support empty batch
  • MemoryRecordsBuilder: support arbitrary offset, skipping offsets
  • Add record.validate_crc() for v0/v1 crc checks
  • Remove fetcher message_generator / iterator interface
  • Add size_in_bytes to ABCRecordBatch and implement for Legacy and Default
  • Add magic property to ABCRecord and implement for LegacyRecord