You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-kafka-docs/src/main/asciidoc/appendix.adoc
+4-2
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,12 @@
2
2
== Override Spring Boot Dependencies
3
3
4
4
When using Spring for Apache Kafka in a Spring Boot application, the Apache Kafka dependency versions are determined by Spring Boot's dependency management.
5
-
If you wish to use a different version of `kafka-clients` or `kafka-streams`, such as 2.8.0, you need to override all of the associated dependencies.
5
+
If you wish to use a different version of `kafka-clients` or `kafka-streams`, such as 3.0.0, you need to override all of the associated dependencies.
6
6
This is especially true when using the embedded Kafka broker in `spring-kafka-test`.
7
7
8
-
IMPORTANT: Backwards compatibility is not supported for all Boot versions; Spring for Apache Kafka 2.7 has been tested with Spring Boot 2.4 and 2.5.
8
+
IMPORTANT: Backwards compatibility is not supported for all Boot versions; Spring for Apache Kafka 2.8 has been tested with Spring Boot 2.5 and 2.6.
9
+
10
+
IMPORTANT: When using the 3.0.0 clients, the default `EOSMode.V2` is not supported unless the broker is 2.5 or higher; if you wish to use the 3.0.0 clients with an earlier broker, you must change the container's `EOSMode` to `V1`.
Copy file name to clipboardExpand all lines: spring-kafka-docs/src/main/asciidoc/kafka.adoc
+17-10
Original file line number
Diff line number
Diff line change
@@ -2462,7 +2462,7 @@ The default executor creates threads named `<name>-C-n`; with the `KafkaMessageL
2462
2462
|See <<delivery-header>>.
2463
2463
2464
2464
|[[eosMode]]<<eosMode,`eosMode`>>
2465
-
|`BETA`
2465
+
|`V2`
2466
2466
|Exactly Once Semantics mode; see <<exactly-once>>.
2467
2467
2468
2468
|[[fixTxOffsets]]<<fixTxOffsets,`fixTxOffsets`>>
@@ -3534,33 +3534,40 @@ This means that, for a `read->process-write` sequence, it is guaranteed that the
3534
3534
3535
3535
Spring for Apache Kafka version 2.5 and later supports two EOS modes:
3536
3536
3537
-
* `ALPHA` - aka `transactional.id` fencing (since version 0.11.0.0)
3538
-
* `BETA` - aka fetch-offset-request fencing (since version 2.5)
3537
+
* `ALPHA` - alias for `V1` (deprecated)
3538
+
* `BETA` - alias for `V2` (deprecated)
3539
+
* `V1` - aka `transactional.id` fencing (since version 0.11.0.0)
3540
+
* `V2` - aka fetch-offset-request fencing (since version 2.5)
3539
3541
3540
-
With mode `ALPHA`, the producer is "fenced" if another instance with the same `transactional.id` is started.
3542
+
With mode `V1`, the producer is "fenced" if another instance with the same `transactional.id` is started.
3541
3543
Spring manages this by using a `Producer` for each `group.id/topic/partition`; when a rebalance occurs a new instance will use the same `transactional.id` and the old producer is fenced.
3542
3544
3543
-
With mode `BETA`, it is not necessary to have a producer for each `group.id/topic/partition` because consumer metadata is sent along with the offsets to the transaction and the broker can determine if the producer is fenced using that information instead.
3545
+
With mode `V2`, it is not necessary to have a producer for each `group.id/topic/partition` because consumer metadata is sent along with the offsets to the transaction and the broker can determine if the producer is fenced using that information instead.
3544
3546
3545
-
Starting with version 2.6, the default `EOSMode` is `BETA`.
3547
+
Starting with version 2.6, the default `EOSMode` is `V2`.
3546
3548
3547
3549
To configure the container to use mode `ALPHA`, set the container property `EOSMode` to `ALPHA`, to revert to the previous behavior.
3548
3550
3549
-
IMPORTANT: With `BETA`, your brokers must be version 2.5 or later, however with `kafka-clients` version 2.6, the producer will automatically fall back to `ALPHA` if the broker does not support `BETA`.
3551
+
IMPORTANT: With `V2`, your brokers must be version 2.5 or later, however with `kafka-clients` version 2.6, the producer will automatically fall back to `ALPHA` if the broker does not support `BETA`.
3550
3552
The `DefaultKafkaProducerFactory` is configured to enable that behavior.
3551
3553
If your brokers are earlier than 2.5, be sure to leave the `DefaultKafkaProducerFactory` `producerPerConsumerPartition` set to `true` and, if you are using a batch listener, you should set `subBatchPerPartition` to `true`.
3552
3554
3553
-
When your brokers are upgraded to 2.5 or later, the producer will automatically switch to using mode `BETA`, but the number of producers will remain as before.
3555
+
When your brokers are upgraded to 2.5 or later, the producer will automatically use mode `V2`, but the number of producers will remain as before.
3554
3556
You can then do a rolling upgrade of your application with `producerPerConsumerPartition` set to `false` to reduce the number of producers; you should also no longer set the `subBatchPerPartition` container property.
3555
3557
3556
3558
If your brokers are already 2.5 or newer, you should set the `DefaultKafkaProducerFactory` `producerPerConsumerPartition` property to `false`, to reduce the number of producers needed.
3557
3559
3558
-
IMPORTANT: When using `EOSMode.BETA` with `producerPerConsumerPartition=false` the `transactional.id` must be unique across all application instances.
3560
+
IMPORTANT: When using `EOSMode.V2` with `producerPerConsumerPartition=false` the `transactional.id` must be unique across all application instances.
3559
3561
3560
-
When using `BETA` mode, it is no longer necessary to set the `subBatchPerPartition` to `true`; it will default to `false` when the `EOSMode` is `BETA`.
3562
+
When using `V2` mode, it is no longer necessary to set the `subBatchPerPartition` to `true`; it will default to `false` when the `EOSMode` is `V2`.
3561
3563
3562
3564
Refer to https://cwiki.apache.org/confluence/display/KAFKA/KIP-447%3A+Producer+scalability+for+exactly+once+semantics[KIP-447] for more information.
3563
3565
3566
+
IMPORTANT: `kafka-clients` 3.0.0 and later no longer support `V2` (and automatic fallback to `V1`) with brokers earlier than 2.5; you must therefore override the default (`V2`) with `V1` if your brokers are older (or upgrade your brokers).
3567
+
3568
+
`V1` and `V2` were previously `ALPHA` and `BETA`; they have been changed to align the framework with https://cwiki.apache.org/confluence/display/KAFKA/KIP-732%3A+Deprecate+eos-alpha+and+replace+eos-beta+with+eos-v2[KIP-732].
3569
+
3570
+
3564
3571
[[interceptors]]
3565
3572
==== Wiring Spring Beans into Producer/Consumer Interceptors
0 commit comments