This is an automated email from the ASF dual-hosted git repository. orpiske pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 02fa048e5cac9e508b0282f9dbdd4649928cc074 Author: Otavio Rodolfo Piske <angusyo...@gmail.com> AuthorDate: Thu Feb 1 13:26:13 2024 +0100 CAMEL-20380: added a note about the shutdown timeout This should prevent unclean shutdown and lost information with batching --- .../camel-kafka/src/main/docs/kafka-component.adoc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/components/camel-kafka/src/main/docs/kafka-component.adoc b/components/camel-kafka/src/main/docs/kafka-component.adoc index b91231aa4f4..11478a4df05 100644 --- a/components/camel-kafka/src/main/docs/kafka-component.adoc +++ b/components/camel-kafka/src/main/docs/kafka-component.adoc @@ -616,3 +616,24 @@ public void configure() { } ---- include::spring-boot:partial$starter.adoc[] + +==== Dealing with long polling timeouts + +In some cases, applications may want the polling process to have a long timeout (see: `pollTimeoutMs`). + +To properly do so, first make sure to have a max polling interval that is higher than the polling timeout (see: `maxPollIntervalMs`). + +Then, increase the shutdown timeout to ensure that committing, closing and other Kafka operations are not abruptly aborted. For instance: + +[source,java] +---- +public void configure() { + // Note that this can be configured in other ways + getCamelContext().getShutdownStrategy().setTimeout(10000); + + // route setup ... +} +---- + + +