This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch kaf-int
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/kaf-int by this push:
new bb02ce5d02e CAMEL-21691: camel-kafka - Add batchingIntervalMs option
to trigger batch completion per interval
bb02ce5d02e is described below
commit bb02ce5d02e31e61411e7d4d1f31b38169d7caf4
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Feb 3 10:20:18 2025 +0100
CAMEL-21691: camel-kafka - Add batchingIntervalMs option to trigger batch
completion per interval
---
components/camel-kafka/src/main/docs/kafka-component.adoc | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/components/camel-kafka/src/main/docs/kafka-component.adoc
b/components/camel-kafka/src/main/docs/kafka-component.adoc
index 90da341743e..c86c750efd8 100644
--- a/components/camel-kafka/src/main/docs/kafka-component.adoc
+++ b/components/camel-kafka/src/main/docs/kafka-component.adoc
@@ -430,7 +430,16 @@ To avoid blocking for too long, waiting for the whole set
of records to fill the
to set a timeout for the polling. The timeout is only triggered if there has
not received any new messages for the given timeout period.
So for example if `pollTimeoutMs=10000` then the timeout is 10 seconds, and
this will only trigger if Camel did not receive any new messages
from Kafka for 10 seconds. The timeout trigger will reset if a message has
been received, so if you continuously and slowly receive new messages,
-then this timeout may newer trigger.
+then this timeout may not trigger for a long time. Therefore, the option
`batchingIntervalMs` can therefore be used to specify an interval (in mills)
+to trigger the batch completion, to avoid waiting for more messages to be
received to reach the batch size.
+For example setting `batchingIntervalMs=20000` would let Camel wait at most
`pollTimeoutMs + batchingIntervalMs` before
+triggering a batch completion. In this example that would be 30 seconds.
+
+Notice the `pollTimeoutMs` should not be set to a high value, as it's used
directly by Kafka while
+receiving new messages from the broker. Camel is not active during this
processing, and if the option
+has been configured with a high value, then Camel cannot trigger batch timeout
or interval completion ahead
+of time. Therefore, it's recommended to keep this value as default.
+
==== Automatic Commits