[
https://issues.apache.org/jira/browse/CAMEL-17489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-17489.
---------------------------------
Resolution: Fixed
> camel-kafka - 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
> Priority: Minor
> Fix For: 3.14.1, 3.15.0
>
>
> 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 unsubscribing in *run* method fails with "This consumer has already
> been closed"
> {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)