This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch camel-3.14.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 49af1a9ac2b1f0c114dd4b6af4a1246fb77186a9
Author: Rafał Gała <[email protected]>
AuthorDate: Fri Jan 14 12:22:29 2022 +0100

    CAMEL-17489: camel-kafka - Unsubscribe before closing the consumer
---
 .../main/java/org/apache/camel/component/kafka/KafkaFetchRecords.java    | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaFetchRecords.java
 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaFetchRecords.java
index 2ebd8bf..e1c5b03 100644
--- 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaFetchRecords.java
+++ 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaFetchRecords.java
@@ -208,6 +208,7 @@ class KafkaFetchRecords implements Runnable {
             // only close if not retry
             if (!isRetrying()) {
                 LOG.debug("Closing consumer {}", threadId);
+                safeUnsubscribe();
                 IOHelper.close(consumer);
             }
         }

Reply via email to