Kafka Java Client Changelog

This changelog lists the client-facing changes in each Apache Kafka® release. The Kafka Java Client ships as part of Apache Kafka® rather than as a separate Confluent artifact, so its version numbers match the Apache Kafka® release they come from.

Entries include the clients, consumer, producer, and admin components. For changes to brokers, Kafka Streams, or Connect, see the Kafka full release notes.

Kafka 4.3.1

Kafka 4.3.1 is a maintenance release. For the complete list of changes across all Kafka components, see the |ak| 4.3.1 release notes.

Fixes

  • KAFKA-20673 - AdminClient partition-leader APIs hang when a cached leader has left the cluster.

Kafka 4.3.0

Kafka 4.3.0 is a feature release. For the complete list of changes across all Kafka components, see the |ak| 4.3.0 release notes.

Enhancements

  • KAFKA-17019 - Producer TimeoutException should include root cause.

  • KAFKA-18608 - Enhancing Apache Kafka OAuth2 Authentication: Adding Support for private_key_jwt Client Assertion.

  • KAFKA-19833 - Reduce code duplication in nullable protocol types.

  • KAFKA-20065 - Improve tagging of code examples in javadoc.

  • KAFKA-20341 - Clarify that assignment() and subscription() return a snapshot, not a live view.

Fixes

  • KAFKA-19542 - Consumer.close() does not remove all added sensors from Metrics.

  • KAFKA-19932 - AdminClient throws TimeoutException when underlying cause is OutOfMemoryError.

  • KAFKA-20128 - TimestampType missing in public API docs.

  • KAFKA-20131 - ClassicKafkaConsumer does not clear endOffsetRequested flag on failed LIST_OFFSETS calls.

  • KAFKA-20165 - Consumer poll may fail with unrecoverable KafkaException if topic not in metadata when fetching committed offsets.

  • KAFKA-20183 - Share consumer group fails when group ID contains colon character.

  • KAFKA-20321 - Mark partitions lost to avoid potential race with buffered records.

  • KAFKA-20332 - Ensure app thread not collecting records for partitions being revoked.

  • KAFKA-20382 - Improve interrupts handling when updating assignment for callbacks.

  • KAFKA-20393 - Kafka client send to wrong IP caused by stickyNode in TelemetrySender.

  • KAFKA-20426 - Using group.id and assign() causes a busy loop in AsyncKafkaConsumer.

  • KAFKA-20428 - Consumer unsubscribe could fail processing previous assignment change events.

Kafka 4.2.1

Kafka 4.2.1 is a maintenance release. For the complete list of changes across all Kafka components, see the |ak| 4.2.1 release notes.

Fixes

  • KAFKA-20131 - ClassicKafkaConsumer does not clear endOffsetRequested flag on failed LIST_OFFSETS calls.

  • KAFKA-20165 - Consumer poll may fail with unrecoverable KafkaException if topic not in metadata when fetching committed offsets.

  • KAFKA-20183 - Share consumer group fails when group ID contains colon character.

  • KAFKA-20332 - Ensure app thread not collecting records for partitions being revoked.

  • KAFKA-20393 - Kafka client send to wong IP caused by stickyNode in TelemetrySender.

Kafka 4.2.0

Kafka 4.2.0 is a feature release. For the complete list of changes across all Kafka components, see the |ak| 4.2.0 release notes.

Enhancements

  • KAFKA-14768 - Add latency optimization guidance to KafkaProducer.send().

  • KAFKA-19296 - Revise AsyncKafkaConsumer event wakeup approach.

  • KAFKA-19435 - Optimize kafka-consumer-groups.sh to return the offset info of other partitions even when the leader of some partitions are missing.

  • KAFKA-19589 - Check for ability to skip position validation in application thread when collecting buffered data.

  • KAFKA-19747 - Improve handling of failed push telemetry request.

  • KAFKA-19820 - Remove the unnecessary copy from AbstractFetch#fetchablePartitions.

  • KAFKA-19822 - Remove all static classes in Field except TaggedFieldsSection.

  • KAFKA-19946 - Reduce unnecessary work in share session handler.

Fixes

  • KAFKA-12999 - NPE when accessing RecordHeader.key() concurrently.

  • KAFKA-17089 - Incorrect JWT parsing in OAuthBearerUnsecuredJws.

  • KAFKA-17554 - Flaky testFutureCompletionOutsidePoll in ConsumerNetworkClientTest.

  • KAFKA-17725 - RecordHeader key() is not thread safe.

  • KAFKA-18376 - High CPU load when AsyncKafkaConsumer uses a small max poll value.

  • KAFKA-18471 - Race conditions when accessing RecordHeader data.

  • KAFKA-19012 - Messages ending up on the wrong topic.

  • KAFKA-19213 - Kafka java client ignores default properties.

  • KAFKA-19233 - Members cannot rejoin with epoch=0 for KIP-848.

  • KAFKA-19259 - Async consumer fetch intermittent delays on console consumer.

  • KAFKA-19357 - AsyncConsumer#close hangs during closing because the commitAsync request never completes due to a missing coordinator.

  • KAFKA-19394 - Failure in ConsumerNetworkThread.initializeResources() can cause hangs on AsyncKafkaConsumer.close().

  • KAFKA-19493 - Incorrect rate metric with larger window size.

  • KAFKA-19504 - AdminClient creates and adds second metrics reporter.

  • KAFKA-19564 - Close Consumer in ConsumerPerformance only after metrics displayed.

  • KAFKA-19617 - ConsumerPerformance#ConsumerPerfRebListener get corrupted value when the number of partitions is increased.

  • KAFKA-19722 - Missing assigned-partitions metric in new consumer.

  • KAFKA-19781 - Consumer NoOffsetForPartitionException for partitions being revoked.

  • KAFKA-19813 - Incorrect jitter value in StreamsGroupHeartbeatRequestManager and AbstractHeartbeatRequestManager.

  • KAFKA-20040 - Race condition on consumer updating positions and unsubscribe when using committed offsets with topic ID.

  • KAFKA-20064 - A race condition in admin client can lead to the result future never being completed.

  • KAFKA-7700 - AbstractConfig does not honor Properties defaults.

Kafka 4.1.2

Kafka 4.1.2 is a maintenance release. For the complete list of changes across all Kafka components, see the |ak| 4.1.2 release notes.

Fixes

  • KAFKA-19012 - Messages ending up on the wrong topic.

  • KAFKA-20064 - A race condition in admin client can lead to the result future never being completed.

  • KAFKA-20131 - ClassicKafkaConsumer does not clear endOffsetRequested flag on failed LIST_OFFSETS calls.

Kafka 4.1.1

Kafka 4.1.1 is a maintenance release. For the complete list of changes across all Kafka components, see the |ak| 4.1.1 release notes.

Enhancements

  • KAFKA-19747 - Improve handling of failed push telemetry request.

Fixes

  • KAFKA-19593 - Stuck __consumer_offsets partition (Kafka Streams app).

Kafka 4.1.0

Kafka 4.1.0 is a feature release. For the complete list of changes across all Kafka components, see the |ak| 4.1.0 release notes.

Enhancements

  • KAFKA-10790 - Detect/Prevent Deadlock on Producer Network Thread.

  • KAFKA-15767 - Refactor TransactionManager to avoid use of ThreadLocal.

  • KAFKA-16260 - Deprecate window.size.ms and window.inner.serde.class in StreamsConfig.

  • KAFKA-16758 - Extend Consumer#close with option to leave the group or not.

  • KAFKA-16906 - Add consistent error handling for Transactions.

  • KAFKA-18573 - Add support for OAuth jwt-bearer grant type.

  • KAFKA-18729 - Improve consumer check for assigned topics from regex.

  • KAFKA-18847 - Refactor OAuth layer to improve reusability.

  • KAFKA-18881 - Document the ConsumerRecord as non-thread safe.

  • KAFKA-19002 - Rewrite ListOffsetsIntegrationTest and move it to clients-integration-test.

  • KAFKA-19060 - Documented null edge cases in the Clients API JavaDoc.

  • KAFKA-19152 - Add top-level documentation for OAuth flows.

  • KAFKA-19214 - Clean up use of Optionals in RequestManagers.entries().

  • KAFKA-19295 - Remove AsyncKafkaConsumer event ID generation.

  • KAFKA-19297 - Refactor AsyncKafkaConsumer’s use of Java Streams APIs in critical sections.

  • KAFKA-8830 - KIP-512: make Record Headers available in onAcknowledgement.

Fixes

  • KAFKA-12469 - The topic names in the metrics do not retain their format when extracting through JMX.

  • KAFKA-17182 - Consumer fetch sessions are evicted too quickly with AsyncKafkaConsumer.

  • KAFKA-17516 - Client metrics configuration resources default configs not shown by kafka-configs.sh.

  • KAFKA-18117 - Support topic IDs in consumer SubscriptionState.

  • KAFKA-18135 - ShareConsumer HB UnsupportedVersion msg mixed with Consumer HB.

  • KAFKA-18298 - Fix flaky PlaintextAdminIntegrationTest#testConsumerGroupsDeprecatedConsumerGroupState.

  • KAFKA-18400 - Don’t use YYYY when formatting/parsing dates in Java client.

  • KAFKA-19205 - Inconsistent result of beginningOffsets/endoffset between classic consumer and async consumer with zero timeout.

  • KAFKA-19206 - ConsumerNetworkThread.cleanup() throws NullPointerException if initializeResources() previously failed.

  • KAFKA-19242 - Fix commit bugs caused by race condition during rebalancing.

  • KAFKA-19288 - Ensure new consumer joining attempt not overwritten on delayed HB response to previous leave.

  • KAFKA-19300 - AsyncConsumer#unsubscribe always timeout due to GroupAuthorizationException.

  • KAFKA-19351 - AsyncConsumer#commitAsync should copy the input offsets.

  • KAFKA-19356 - AsyncConsumer should ensure consistency of assigned partitions and subscription.

  • KAFKA-19373 - Fix consumer integration tests checks on protocol name.

  • KAFKA-19397 - TransactionManager.handleCompletedBatch throws NPE.

  • KAFKA-19427 - The __consumer_offsets topic applies the broker configuration message.max.bytes, which may cause the coordinator broker to allocate too much memory and cause OOM.

  • KAFKA-19504 - AdminClient creates and adds second metrics reporter.

Kafka 4.0.2

Kafka 4.0.2 is a maintenance release. For the complete list of changes across all Kafka components, see the |ak| 4.0.2 release notes.

Enhancements

  • KAFKA-19747 - Improve handling of failed push telemetry request.

Fixes

  • KAFKA-19012 - Messages ending up on the wrong topic.

  • KAFKA-20064 - A race condition in admin client can lead to the result future never being completed.

Kafka 4.0.1

Kafka 4.0.1 is a maintenance release. For the complete list of changes across all Kafka components, see the |ak| 4.0.1 release notes.

Fixes

  • KAFKA-19242 - Fix commit bugs caused by race condition during rebalancing.

  • KAFKA-19427 - The __consumer_offsets topic applies the broker configuration message.max.bytes, which may cause the coordinator broker to allocate too much memory and cause OOM.

  • KAFKA-19504 - AdminClient creates and adds second metrics reporter.

Kafka 4.0.0

Kafka 4.0.0 is a feature release. For the complete list of changes across all Kafka components, see the |ak| 4.0.0 release notes.

Enhancements

  • KAFKA-15561 - Client support for new SubscriptionPattern based subscription.

  • KAFKA-16143 - New JMX metrics for AsyncKafkaConsumer.

  • KAFKA-16818 - Move event processing-related tests from ConsumerNetworkThreadTest to ApplicationEventProcessorTest.

  • KAFKA-16899 - Rename MembershipManagerImpl’s rebalanceTimeoutMs for clarity.

  • KAFKA-17137 - Ensure Admin APIs are properly tested.

  • KAFKA-17248 - Extend KIP-714 to allow for registering additional metrics with clients.

  • KAFKA-17340 - Kafka Java SDK ConsumerConfig describe doc is incorrect.

  • KAFKA-17377 - Consider using defaultApiTimeoutMs in AsyncKafkaConsumer#unsubscribe.

  • KAFKA-17536 - Ensure clear error message when “new” consumer used with incompatible cluster.

  • KAFKA-17600 - Add nextOffsets to the ConsumerRecords.

  • KAFKA-17663 - Add Metadata caching in admin.internals.PartitionLeaderStrategy.

  • KAFKA-17686 - AsyncKafkaConsumer.offsetsForTimes() fails with NullPointerException.

  • KAFKA-17885 - Enable clients to rebootstrap based on timeout or error code.

  • KAFKA-17927 - Disallow users to configure max.in.flight.requests.per.connection bigger than 5.

  • KAFKA-17934 - Add duration based offset reset option for consumer clients.

  • KAFKA-17947 - Update currentLag(), pause(), and resume() to update SubscriptionState in background thread.

  • KAFKA-18046 - High CPU usage when using Log4j2.

  • KAFKA-18071 - Avoid unneeded background event to refresh regex if no subscription pattern in use.

  • KAFKA-18096 - Allow new consumer to join group after subscribe to pattern if no matching topics.

Fixes

  • KAFKA-16022 - AsyncKafkaConsumer sometimes complains “No current assignment for partition {}”.

  • KAFKA-16248 - Kafka consumer should cache leader offset ranges.

  • KAFKA-16460 - New consumer times out consuming records in multiple consumer_test.py system tests.

  • KAFKA-16576 - New consumer fails with assert in consumer_test.py’s test_consumer_failure system test.

  • KAFKA-16985 - Ensure consumer attempts to send leave request on close even if interrupted.

  • KAFKA-17040 - Unknown telemetry state: TERMINATED thrown when closing AsyncKafkaConsumer.

  • KAFKA-17064 - New consumer assign should update assignment in background thread.

  • KAFKA-17066 - New consumer updateFetchPositions should perform all operations in background thread.

  • KAFKA-17116 - New consumer may not send effective leave group if member ID received after close.

  • KAFKA-17154 - New consumer subscribe may join group without a call to consumer.poll.

  • KAFKA-17182 - Consumer fetch sessions are evicted too quickly with AsyncKafkaConsumer.

  • KAFKA-17201 - SelectorTest.testInboundConnectionsCountInConnectionCreationMetric leaks sockets and threads.

  • KAFKA-17208 - replica_scale_test.py fails for new consumer.

  • KAFKA-17219 - Adjust system test framework for new protocol consumer.

  • KAFKA-17230 - Kafka consumer client doesn’t report node request-latency metrics.

  • KAFKA-17286 - Flaky PlaintextConsumerSubscriptionTest#testSubscribeInvalidTopic.

  • KAFKA-17293 - New consumer HeartbeatRequestManager should rediscover disconnected coordinator.

  • KAFKA-17294 - Handle retriable errors when fetching offsets in new consumer.

  • KAFKA-17295 - New consumer fails with assert in consumer_test.py’s test_fencing_static_consumer system test.

  • KAFKA-17403 - New consumer may not send leave group on race condition on network thread run & close.

  • KAFKA-17439 - Make polling for new records an explicit action/event in the new consumer.

  • KAFKA-17448 - New consumer seek should update positions in background thread.

  • KAFKA-17455 - TaskCorruptedException After Client Quota Throttling.

  • KAFKA-17470 - CommitRequestManager should record failed request only once even if multiple errors in response.

  • KAFKA-17478 - Wrong configuration of metric.reporters lead to NPE in KafkaProducer constructor.

  • KAFKA-17480 - New consumer commit all consumed should retrieve offsets in background thread.

  • KAFKA-17505 - New consumer seekToBeginning/End should run in background thread.

  • KAFKA-17518 - AsyncKafkaConsumer cannot reliably leave group when closed with small timeout.

  • KAFKA-17519 - Define and validate correctness of Consumer.close() and its timeout when thread is interrupted.

  • KAFKA-17623 - Flaky testSeekPositionAndPauseNewlyAssignedPartitionOnPartitionsAssignedCallback.

  • KAFKA-17661 - Fix flaky BufferPoolTest.testBlockTimeout.

  • KAFKA-17674 - New consumer reset positions for newly added partitions before retrieving committed offsets.

  • KAFKA-17696 - New consumer background operations unaware of metadata errors.

  • KAFKA-17726 - New consumer subscribe/subscribeFromPattern in background thread.

  • KAFKA-17769 - Fix flaky PlaintextConsumerSubscriptionTest.testSubscribeInvalidTopicCanUnsubscribe.

  • KAFKA-17960 - PlaintextAdminIntegrationTest.testConsumerGroups fails with CONSUMER group protocol.

  • KAFKA-18017 - New consumer should notify HB errors to group manager after errors have been handled/propagated.

  • KAFKA-18034 - CommitRequestManager should fail pending requests on fatal coordinator errors.

  • KAFKA-18040 - PlaintextProducerSendTest.testSendToPartitionWithFollowerShutdownShouldNotTimeout fails with CONSUMER group protocol.

  • KAFKA-18085 - Abort inflight requests when rebootstrapping due to timeout or error.

  • KAFKA-18127 - Handle subscription pattern used with v0 HB broker.

  • KAFKA-18189 - CoordinatorRequestManager log message can include incorrect coordinator disconnect time.

  • KAFKA-18194 - Flaky test_broker_rolling_bounce due to metadata update.

  • KAFKA-18259 - Documentation for consumer auto.offset.reset contains invalid HTML.

  • KAFKA-18469 - AsyncConsumer fails to retry ListOffsetRequest on ReplicaNotAvailable error without metadata update.

  • KAFKA-18569 - New consumer close may wait on unneeded FindCoordinator.

  • KAFKA-18619 - New consumer topic metadata events should set requireMetadata flag.

  • KAFKA-18641 - AsyncKafkaConsumer could lose records with auto offset commit.

  • KAFKA-18645 - New consumer should align close timeout handling with classic consumer.

  • KAFKA-18690 - New consumer doesn’t updateLatestMetadata for topics matching new regex.

  • KAFKA-18784 - Fix ConsumerWithLegacyMessageFormatIntegrationTest.