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: src/reference/asciidoc/kafka.adoc
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -3194,19 +3194,20 @@ Instead, a new "nested" transaction is used.
3194
3194
===== `transactionIdPrefix`
3195
3195
3196
3196
As mentioned in <<transactions, the overview>>, the producer factory is configured with this property to build the producer `transactional.id` property.
3197
-
There is rather a dichotomy when specifying this property in that, when running multiple instances of the application, it must be the same on all instances to satisfy fencing zombies (also mentioned in the overview) when producing records on a listener container thread.
3197
+
There is a dichotomy when specifying this property in that, when running multiple instances of the application with `EOSMode.ALPHA`, it must be the same on all instances to satisfy fencing zombies (also mentioned in the overview) when producing records on a listener container thread.
3198
3198
However, when producing records using transactions that are **not** started by a listener container, the prefix has to be different on each instance.
3199
3199
Version 2.3, makes this simpler to configure, especially in a Spring Boot application.
3200
3200
In previous versions, you had to create two producer factories and `KafkaTemplate` s - one for producing records on a listener container thread and one for stand-alone transactions started by `kafkaTemplate.executeInTransaction()` or by a transaction interceptor on a `@Transactional` method.
3201
3201
3202
3202
Now, you can override the factory's `transactionalIdPrefix` on the `KafkaTemplate` and the `KafkaTransactionManager`.
3203
3203
3204
3204
When using a transaction manager and template for a listener container, you would normally leave this to default to the producer factory's property.
3205
-
This value should be the same for all application instances.
3205
+
This value should be the same for all application instances when using `EOSMode.ALPHA`.
3206
+
With `EOSMode.BETA` it is no longer necessary to use the same `transactional.id`, even for consumer-initiated transactions; in fact, it must be unique on each instance the same as producer-initiated transactions.
3206
3207
For transactions started by the template (or the transaction manager for `@Transaction`) you should set the property on the template and transaction manager respectively.
3207
3208
This property must have a different value on each application instance.
3208
3209
3209
-
This problem has been eliminated when `EOSMode.BETA` is being used (with broker versions >= 2.5); see <<exactly-once>>.
3210
+
This problem (different rules for `transactional.id`) has been eliminated when `EOSMode.BETA` is being used (with broker versions >= 2.5); see <<exactly-once>>.
3210
3211
3211
3212
[[tx-template-mixed]]
3212
3213
===== `KafkaTemplate` Transactional and non-Transactional Publishing
@@ -3318,6 +3319,8 @@ You can then do a rolling upgrade of your application with `producerPerConsumerP
3318
3319
3319
3320
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.
3320
3321
3322
+
IMPORTANT: When using `EOSMode.BETA` with `producerPerConsumerPartition=false` the `transactional.id` must be unique across all application instances.
3323
+
3321
3324
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`.
3322
3325
3323
3326
Refer to https://cwiki.apache.org/confluence/display/KAFKA/KIP-447%3A+Producer+scalability+for+exactly+once+semantics[KIP-447] for more information.
0 commit comments