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 4a657342043f912e5cc733266b9167e20fb0fc5d
Author: Otavio Rodolfo Piske <angusyo...@gmail.com>
AuthorDate: Tue Aug 2 11:30:50 2022 +0200

    CAMEL-18327: remove unnecessary consumer unsubscription
    
    Unsubscribing the consumer is already done when handling poll() exceptions. 
This removes the redundant unsubscription calls.
---
 .../main/java/org/apache/camel/component/kafka/KafkaFetchRecords.java  | 3 ---
 1 file changed, 3 deletions(-)

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 e92d08f4c19..af29ba74840 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
@@ -162,7 +162,6 @@ public class KafkaFetchRecords implements Runnable {
             LOG.info("Terminating KafkaConsumer thread {} receiving from {}", 
threadId, getPrintableTopic());
         }
 
-        safeUnsubscribe();
         IOHelper.close(consumer);
     }
 
@@ -350,8 +349,6 @@ public class KafkaFetchRecords implements Runnable {
             if (LOG.isTraceEnabled()) {
                 LOG.trace("The kafka consumer was woken up while polling on 
thread {} for {}", threadId, getPrintableTopic());
             }
-
-            safeUnsubscribe();
         } catch (Exception e) {
             if (LOG.isDebugEnabled()) {
                 LOG.warn("Exception {} caught by thread {} while polling {} 
from kafka: {}",

Reply via email to