This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 591355b08f5 (chores) camel-kafka: improved the documentation for
handling manual commits with camel-kafka (#8769)
591355b08f5 is described below
commit 591355b08f557f279385af0527bf5d01ece7f72b
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Thu Nov 24 16:43:17 2022 +0100
(chores) camel-kafka: improved the documentation for handling manual
commits with camel-kafka (#8769)
---
components/camel-kafka/src/main/docs/kafka-component.adoc | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/components/camel-kafka/src/main/docs/kafka-component.adoc
b/components/camel-kafka/src/main/docs/kafka-component.adoc
index e6d289af58f..07f431090dd 100644
--- a/components/camel-kafka/src/main/docs/kafka-component.adoc
+++ b/components/camel-kafka/src/main/docs/kafka-component.adoc
@@ -369,13 +369,16 @@ This will force a synchronous commit which will block
until the commit is acknow
You can use an asynchronous commit as well by configuring the
`KafkaManualCommitFactory` with the `DefaultKafkaManualAsyncCommitFactory`
implementation.
Then the commit will be done in the next consumer loop using the kafka
asynchronous commit api.
-Be aware that records from a partition must be processed and committed by a
unique thread.
-If not, this could lead with non-consistent behaviors.
-This is mostly useful with aggregation's completion timeout strategies.
If you want to use a custom implementation of `KafkaManualCommit` then you can
configure a custom `KafkaManualCommitFactory`
on the `KafkaComponent` that creates instances of your custom implementation.
+*Note 1*: records from a partition must be processed and committed by the same
thread as the consumer. This means that certain EIPs, async or concurrent
operations
+in the DSL, may cause the commit to fail. In such circumstances, tyring to
commit the transaction will cause the Kafka client to throw a
`java.util.ConcurrentModificationException`
+exception with the message `KafkaConsumer is not safe for multi-threaded
access`. To prevent this from happening, redesign your route to avoid those
operations.
+
+*Note 2: this is mostly useful with aggregation's completion timeout
strategies.
+
== Pausable Consumers
The Kafka component supports pausable consumers. This type of consumer can
pause consuming data based on