Releases: dpkp/kafka-python
Releases · dpkp/kafka-python
2.2.4
2.1.6
2.2.3
2.2.2
2.2.1
2.2.0
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
2.1.5
2.1.4
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
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
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