Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-17489

camel-kafka - Unsubscribing fails due to already closed consumer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.14.0
    • 3.14.1, 3.15.0
    • camel-kafka
    • None
    • Unknown

    Description

      In KafkaFetchRecords, when an exception occurs inside startPolling method, the consumer is closed in finally block:

      finally {
          lock.unlock();
      
          // only close if not retry
          if (!isRetrying()) {
              LOG.debug("Closing consumer {}", threadId);
              IOHelper.close(consumer);
          }
      } 

       and then unsubscribing in run method fails with "This consumer has already been closed"

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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rgala Rafał Gała
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: