Rafał Gała created CAMEL-17489:
----------------------------------

             Summary: Unsubscribing fails due to already closed consumer
                 Key: CAMEL-17489
                 URL: https://issues.apache.org/jira/browse/CAMEL-17489
             Project: Camel
          Issue Type: Bug
          Components: camel-kafka
    Affects Versions: 3.14.0
            Reporter: Rafał Gała


In {*}KafkaFetchRecords{*}, when an exception occurs inside *startPolling* 
method, the consumer is closed in finally block:
{code:java}
finally {
    lock.unlock();

    // only close if not retry
    if (!isRetrying()) {
        LOG.debug("Closing consumer {}", threadId);
        IOHelper.close(consumer);
    }
} {code}
 and then unsibscribing in *run* method fails with "Consumer already closed 
error"

 
{code:java}
LOG.info("Terminating KafkaConsumer thread: {} receiving from topic: {}", 
threadId, topicName);
safeUnsubscribe();
IOHelper.close(consumer); {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to