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-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -256,7 +256,12 @@ Spring for Apache Kafka adds support in several ways.
256
256
Transactions are enabled by providing the `DefaultKafkaProducerFactory` with a `transactionIdPrefix`.
257
257
In that case, instead of managing a single shared `Producer`, the factory maintains a cache of transactional producers.
258
258
When the user `close()` s a producer, it is returned to the cache for reuse instead of actually being closed.
259
-
The `transactional.id` property of each producer is `transactionIdPrefix` + `n`, where `n` starts with `0` and is incremented for each new producer.
259
+
The `transactional.id` property of each producer is `transactionIdPrefix` + `n`, where `n` starts with `0` and is incremented for each new producer, unless the transaction is started by a listener container with a record-based listener.
260
+
In that case, the `transactional.id` is `<transactionIdPrefix>.<group.id>.<topic>.<partition>`; this is to properly support fencing zombies https://www.confluent.io/blog/transactions-apache-kafka/[as described here].
261
+
This new behavior was added in versions 1.3.7, 2.0.6, 2.1.10, and 2.2.0.
262
+
If you wish to revert to the previous behavior, set the `producerPerConsumerPartition` property on the `DefaultKafkaProducerFactory` to `false`.
263
+
264
+
NOTE: While transactions are supported with batch listeners, zombie fencing cannot be supported because a batch may contain records from multiple topics/partitions.
Copy file name to clipboardExpand all lines: src/reference/asciidoc/whats-new.adoc
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -79,3 +79,9 @@ See <<serdes>> for more information.
79
79
The streams configuration bean must now be a simple `Properties` object instead of a `StreamsConfig`.
80
80
81
81
See <<kafka-streams>> for more information.
82
+
83
+
84
+
==== Transactional Id
85
+
86
+
When a transaction is started by the listener container, the `transactional.id` is now the `transactionIdPrefix` appended with `<group.id>.<topic>.<partition>`.
87
+
This is to allow proper fencing of zombies https://www.confluent.io/blog/transactions-apache-kafka/[as described here].
0 commit comments