Skip to content

Commit 01e250d

Browse files
authored
Adding whats-new section for 4.0.0
Signed-off-by: Soby Chacko <[email protected]>
1 parent 579ae6a commit 01e250d

File tree

2 files changed

+113
-48
lines changed

2 files changed

+113
-48
lines changed

spring-kafka-docs/src/main/antora/modules/ROOT/pages/appendix/change-history.adoc

+69
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,75 @@
11
[[history]]
22
= Change History
33

4+
[[what-s-new-in-3-3-since-3-2]]
5+
== What's New in 3.3 Since 3.2
6+
:page-section-summary-toc: 1
7+
8+
This section covers the changes made from version 3.2 to version 3.3.
9+
For changes in earlier version, see xref:appendix/change-history.adoc[Change History].
10+
11+
[[x33-dlt-topic-naming]]
12+
=== DLT Topic Naming Convention
13+
14+
The naming convention for DLT topics has been standardized to use the "-dlt" suffix consistently. This change ensures compatibility and avoids conflicts when transitioning between different retry solutions. Users who wish to retain the ".DLT" suffix behavior need to opt-in explicitly by setting the appropriate DLT name property.
15+
16+
[[x33-seek-with-group-id]]
17+
=== Enhanced Seek Operations for Consumer Groups
18+
19+
A new method, `getGroupId()`, has been added to the `ConsumerSeekCallback` interface.
20+
This method allows for more selective seek operations by targeting only the desired consumer group.
21+
The `AbstractConsumerSeekAware` can also now register, retrieve, and remove all callbacks for each topic partition in a multi-group listener scenario without missing any.
22+
See the new APIs (`getSeekCallbacksFor(TopicPartition topicPartition)`, `getTopicsAndCallbacks()`) for more details.
23+
For more details, see xref:kafka/seek.adoc#seek[Seek API Docs].
24+
25+
[[x33-new-option-ignore-empty-batch]]
26+
=== Configurable Handling of Empty Batches in Kafka Listener with RecordFilterStrategy
27+
28+
`RecordFilterStrategy` now supports ignoring empty batches that result from filtering.
29+
This can be configured through overriding default method `ignoreEmptyBatch()`, which defaults to false, ensuring `KafkaListener` is invoked even if all `ConsumerRecords` are filtered out.
30+
For more details, see xref:kafka/receiving-messages/filtering.adoc[Message receive filtering Docs].
31+
32+
33+
[[x33-concurrent-container-stopped-event]]
34+
=== ConcurrentContainerStoppedEvent
35+
36+
The `ConcurentContainerMessageListenerContainer` emits now a `ConcurrentContainerStoppedEvent` when all of its child containers are stopped.
37+
For more details, see xref:kafka/events.adoc[Application Events] and `ConcurrentContainerStoppedEvent` Javadocs.
38+
39+
[[x33-original-record-key-in-reply]]
40+
=== Original Record Key in Reply
41+
42+
When using `ReplyingKafkaTemplate`, if the original record from the request contains a key, then that same key will be part of the reply as well.
43+
For more details, see xref:kafka/sending-messages.adoc[Sending Messages] section of the reference docs.
44+
45+
[[x33-customize-logging-in-DeadLetterPublishingRecovererFactory]]
46+
=== Customizing Logging in DeadLetterPublishingRecovererFactory
47+
48+
When using `DeadLetterPublishingRecovererFactory`, the user applications can override the `maybeLogListenerException` method to customize the logging behavior.
49+
50+
[[x33-customize-admin-client-in-KafkaAdmin]]
51+
=== Customize Admin client in KafkaAdmin
52+
53+
When extending `KafkaAdmin`, user applications may override the `createAdmin` method to customize Admin client creation.
54+
55+
[[x33-customize-kafka-streams-implementation]]
56+
=== Customizing The Implementation of Kafka Streams
57+
58+
When using `KafkaStreamsCustomizer` it is now possible to return a custom implementation of the `KafkaStreams` object by overriding the `initKafkaStreams` method.
59+
60+
[[x33-kafka-headers-for-batch-listeners]]
61+
=== KafkaHeaders.DELIVERY_ATTEMPT for batch listeners
62+
63+
When using a `BatchListener`, the `ConsumerRecord` can have the `KafkaHeaders.DELIVERY_ATTMPT` header in its headers fields.
64+
If the `DeliveryAttemptAwareRetryListener` is set to error handler as retry listener, each `ConsumerRecord` has delivery attempt header.
65+
For more details, see xref:kafka/annotation-error-handling.adoc#delivery-attempts-header-for-batch-listener[Kafka Headers for Batch Listener].
66+
67+
[[x33-task-scheduler-for-kafka-metrics]]
68+
=== Kafka Metrics Listeners and `TaskScheduler`
69+
70+
The `MicrometerProducerListener`, `MicrometerConsumerListener` and `KafkaStreamsMicrometerListener` can now be configured with a `TaskScheduler`.
71+
See `KafkaMetricsSupport` JavaDocs and xref:kafka/micrometer.adoc[Micrometer Support] for more information.
72+
473
[[what-s-new-in-3-2-since-3-1]]
574
== What's New in 3.2 Since 3.1
675
:page-section-summary-toc: 1
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,66 @@
11
= What's new?
22

3-
[[what-s-new-in-3-3-since-3-2]]
4-
== What's New in 3.3 Since 3.2
3+
[[whats-new-in-4-0-since-3-3]]
4+
== What's New in 4.0 Since 3.3
55
:page-section-summary-toc: 1
66

7-
This section covers the changes made from version 3.2 to version 3.3.
8-
For changes in earlier version, see xref:appendix/change-history.adoc[Change History].
7+
This section covers the changes made from version 3.3 to version 4.0.
8+
For changes in earlier versions, see xref:appendix/change-history.adoc[Change History].
99

10-
[[x33-dlt-topic-naming]]
11-
=== DLT Topic Naming Convention
10+
[[x40-apache-kafka-4-0-upgrade]]
11+
=== Apache Kafka 4.0 Client Upgrade
1212

13-
The naming convention for DLT topics has been standardized to use the "-dlt" suffix consistently. This change ensures compatibility and avoids conflicts when transitioning between different retry solutions. Users who wish to retain the ".DLT" suffix behavior need to opt-in explicitly by setting the appropriate DLT name property.
13+
Spring for Apache Kafka has been upgraded to use Apache Kafka client version `4.0.0`.
14+
This upgrade brings several important changes:
1415

15-
[[x33-seek-with-group-id]]
16-
=== Enhanced Seek Operations for Consumer Groups
16+
* All ZooKeeper-based functionality has been removed as Kafka 4.0 fully transitions to KRaft mode
17+
* The ZooKeeper dependency has been removed from the project
18+
* The embedded Kafka test framework now exclusively uses KRaft mode
19+
* The `EmbeddedKafkaZKBroker` class has been removed, and all functionality is now handled by `EmbeddedKafkaKraftBroker`
1720

18-
A new method, `getGroupId()`, has been added to the `ConsumerSeekCallback` interface.
19-
This method allows for more selective seek operations by targeting only the desired consumer group.
20-
The `AbstractConsumerSeekAware` can also now register, retrieve, and remove all callbacks for each topic partition in a multi-group listener scenario without missing any.
21-
See the new APIs (`getSeekCallbacksFor(TopicPartition topicPartition)`, `getTopicsAndCallbacks()`) for more details.
22-
For more details, see xref:kafka/seek.adoc#seek[Seek API Docs].
21+
[[x40-embedded-kafka-test-changes]]
22+
=== Embedded Kafka Test Framework Changes
2323

24-
[[x33-new-option-ignore-empty-batch]]
25-
=== Configurable Handling of Empty Batches in Kafka Listener with RecordFilterStrategy
24+
The test infrastructure has been significantly updated:
2625

27-
`RecordFilterStrategy` now supports ignoring empty batches that result from filtering.
28-
This can be configured through overriding default method `ignoreEmptyBatch()`, which defaults to false, ensuring `KafkaListener` is invoked even if all `ConsumerRecords` are filtered out.
29-
For more details, see xref:kafka/receiving-messages/filtering.adoc[Message receive filtering Docs].
26+
* The `EmbeddedKafkaRule` JUnit 4 rule has been removed
27+
* The `@EmbeddedKafka` annotation has been simplified with the removal of ZooKeeper-related properties:
28+
* The `kraft` property has been removed as KRaft mode is now the only option
29+
* ZooKeeper-specific properties like `zookeeperPort`, `zkConnectionTimeout`, and `zkSessionTimeout` have been removed
30+
* KafkaClusterTestKit imports now use new packages for KRaft mode
31+
* Some tests have been updated to address limitations with static port assignments in KRaft mode
32+
* Adjustments have been made to replication factors in tests to accommodate KRaft requirements
3033

34+
[[x40-consumer-records-constructor-changes]]
35+
=== ConsumerRecords Constructor Changes
3136

32-
[[x33-concurrent-container-stopped-event]]
33-
=== ConcurrentContainerStoppedEvent
37+
The `ConsumerRecords` constructor now requires an additional `Map` parameter, which has been addressed throughout the framework.
38+
Applications that directly use this constructor will need to update their code.
3439

35-
The `ConcurentContainerMessageListenerContainer` emits now a `ConcurrentContainerStoppedEvent` when all of its child containers are stopped.
36-
For more details, see xref:kafka/events.adoc[Application Events] and `ConcurrentContainerStoppedEvent` Javadocs.
40+
[[x40-producer-interface-updates]]
41+
=== Producer Interface Updates
3742

38-
[[x33-original-record-key-in-reply]]
39-
=== Original Record Key in Reply
43+
New methods from the Kafka Producer interface have been implemented:
4044

41-
When using `ReplyingKafkaTemplate`, if the original record from the request contains a key, then that same key will be part of the reply as well.
42-
For more details, see xref:kafka/sending-messages.adoc[Sending Messages] section of the reference docs.
45+
* `registerMetricForSubscription`
46+
* `unregisterMetricFromSubscription`
4347

44-
[[x33-customize-logging-in-DeadLetterPublishingRecovererFactory]]
45-
=== Customizing Logging in DeadLetterPublishingRecovererFactory
48+
[[x40-removed-deprecated-functionality]]
49+
=== Removed Deprecated Functionality
4650

47-
When using `DeadLetterPublishingRecovererFactory`, the user applications can override the `maybeLogListenerException` method to customize the logging behavior.
51+
Several deprecated items have been removed:
4852

49-
[[x33-customize-admin-client-in-KafkaAdmin]]
50-
=== Customize Admin client in KafkaAdmin
53+
* The deprecated `partitioner` classes have been removed from runtime hints
54+
* The deprecated `sendOffsetsToTransaction` method that used `String consumerGroupId` has been removed
5155

52-
When extending `KafkaAdmin`, user applications may override the `createAdmin` method to customize Admin client creation.
56+
[[x40-kafka-streams-updates]]
57+
=== Kafka Streams API Changes
5358

54-
[[x33-customize-kafka-streams-implementation]]
55-
=== Customizing The Implementation of Kafka Streams
59+
* `KafkaStreamBrancher` has been updated to use the new `split()` and `branch()` methods instead of the deprecated `branch()` method
60+
* The `DeserializationExceptionHandler` has been updated to use the new `ErrorHandlerContext`
5661

57-
When using `KafkaStreamsCustomizer` it is now possible to return a custom implementation of the `KafkaStreams` object by overriding the `initKafkaStreams` method.
62+
[[x40-internal-api-updates]]
63+
=== Internal API Updates related to Apache Kafka 4.0.0
5864

59-
[[x33-kafka-headers-for-batch-listeners]]
60-
=== KafkaHeaders.DELIVERY_ATTEMPT for batch listeners
61-
62-
When using a `BatchListener`, the `ConsumerRecord` can have the `KafkaHeaders.DELIVERY_ATTMPT` header in its headers fields.
63-
If the `DeliveryAttemptAwareRetryListener` is set to error handler as retry listener, each `ConsumerRecord` has delivery attempt header.
64-
For more details, see xref:kafka/annotation-error-handling.adoc#delivery-attempts-header-for-batch-listener[Kafka Headers for Batch Listener].
65-
66-
[[x33-task-scheduler-for-kafka-metrics]]
67-
=== Kafka Metrics Listeners and `TaskScheduler`
68-
69-
The `MicrometerProducerListener`, `MicrometerConsumerListener` and `KafkaStreamsMicrometerListener` can now be configured with a `TaskScheduler`.
70-
See `KafkaMetricsSupport` JavaDocs and xref:kafka/micrometer.adoc[Micrometer Support] for more information.
65+
* The `BrokerAddress` class now uses `org.apache.kafka.server.network.BrokerEndPoint` instead of the deprecated `kafka.cluster.BrokerEndPoint`
66+
* The `GlobalEmbeddedKafkaTestExecutionListener` has been updated to work solely with KRaft mode

0 commit comments

Comments
 (0)