This is an automated email from the ASF dual-hosted git repository.
apupier 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 dfd55294fcd8 Replace deprecated method in Kafka component
dfd55294fcd8 is described below
commit dfd55294fcd8a5412db7fa5ad5a5cc59ac46ae48
Author: Aurélien Pupier <[email protected]>
AuthorDate: Tue Jun 2 12:14:35 2026 +0200
Replace deprecated method in Kafka component
Signed-off-by: Aurélien Pupier <[email protected]>
---
.../camel/processor/resume/kafka/SingleNodeKafkaResumeStrategy.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/components/camel-kafka/src/main/java/org/apache/camel/processor/resume/kafka/SingleNodeKafkaResumeStrategy.java
b/components/camel-kafka/src/main/java/org/apache/camel/processor/resume/kafka/SingleNodeKafkaResumeStrategy.java
index 7d689761a028..32850784eaab 100644
---
a/components/camel-kafka/src/main/java/org/apache/camel/processor/resume/kafka/SingleNodeKafkaResumeStrategy.java
+++
b/components/camel-kafka/src/main/java/org/apache/camel/processor/resume/kafka/SingleNodeKafkaResumeStrategy.java
@@ -43,6 +43,7 @@ import org.apache.camel.resume.cache.ResumeCache;
import org.apache.camel.spi.annotations.JdkService;
import org.apache.camel.util.IOHelper;
import org.apache.camel.util.ObjectHelper;
+import org.apache.kafka.clients.consumer.CloseOptions;
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.consumer.ConsumerRebalanceListener;
import org.apache.kafka.clients.consumer.ConsumerRecord;
@@ -219,7 +220,7 @@ public class SingleNodeKafkaResumeStrategy implements
KafkaResumeStrategy, Camel
if (consumer != null) {
consumer.unsubscribe();
try {
- consumer.close(Duration.ofSeconds(5));
+
consumer.close(CloseOptions.timeout(Duration.ofSeconds(5)));
} catch (Exception e) {
LOG.warn("Error closing the consumer: {} (this error will
be ignored)", e.getMessage(), e);
}