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

Camel leaves Kafka consumers running after shutdown

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.17.0
    • 2.17.1, 2.18.0
    • camel-kafka
    • None
    • wildfly 10
      Java 1.8
      Camel: 2.17.0

    • Unknown

    Description

      After shutting down a camel context, there are still threads running kafka consumers.

      In the logs after the shutdown I can see:

      14:45:57,455 INFO  [org.apache.camel.spring.SpringCamelContext] (ServerService Thread Pool -- 81) Apache Camel 2.17.0 (CamelContext: ucms-camel-ctx) uptime 25.047 seconds
      14:45:57,455 INFO  [org.apache.camel.spring.SpringCamelContext] (ServerService Thread Pool -- 81) Apache Camel 2.17.0 (CamelContext: ucms-camel-ctx) is shutdown in 0.856 seconds
      14:45:57,494 INFO  [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean] (ServerService Thread Pool -- 81) Closing JPA EntityManagerFactory for persistence unit 'default'
      14:45:57,652 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0028: Stopped deployment ucms-wildfly-container-3.0.1-SNAPSHOT.war (runtime-name: ucms-wildfly-container-3.0.1-SNAPSHOT.war) in 1098ms
      14:45:57,906 INFO  [org.jboss.as.repository] (DeploymentScanner-threads - 2) WFLYDR0002: Content removed from location /opt/wildfly/standalone/data/content/20/13979a02e4b4ec178461d06c2de59fbf424215/content
      14:45:57,916 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) WFLYSRV0009: Undeployed "ucms-wildfly-container-3.0.1-SNAPSHOT.war" (runtime-name: "ucms-wildfly-container-3.0.1-SNAPSHOT.war")
      14:46:24,972 INFO  [org.apache.kafka.clients.consumer.internals.AbstractCoordinator] (Camel (ucms-camel-ctx) thread #0 - KafkaTopic[ucmsControlTopic]) Marking the coordinator 2147483647 dead.
      14:46:26,467 INFO  [org.apache.kafka.clients.consumer.internals.AbstractCoordinator] (Camel (ucms-camel-ctx) thread #2 - KafkaTopic[TOPIC1]) Marking the coordinator 2147483647 dead.
      

      So in theory the context is stopped, but I can see threads running with the polling of the sockets of kafka consumers (see attached immage).

      This deployed in an application server (wilfly in my case), causes a lot of issues, because apps get deployed and undeployed without stopping the JVM, but threads from previous deployments are left there.

      Please also bear in mind that kafka (9.0.1) throws warning messages due to the fact that un expected config items are thrown to the kafka consumer properties.

      14:45:33,840 WARN  [org.apache.kafka.clients.consumer.ConsumerConfig] (ServerService Thread Pool -- 76) The configuration sasl.kerberos.ticket.renew.window.factor = 0.8 was supplied but isn't a known config.
      14:45:33,841 WARN  [org.apache.kafka.clients.consumer.ConsumerConfig] (ServerService Thread Pool -- 76) The configuration sasl.kerberos.kinit.cmd = /usr/bin/kinit was supplied but isn't a known config.
      14:45:33,841 WARN  [org.apache.kafka.clients.consumer.ConsumerConfig] (ServerService Thread Pool -- 76) The configuration sasl.kerberos.ticket.renew.jitter = 0.05 was supplied but isn't a known config.
      14:45:33,841 WARN  [org.apache.kafka.clients.consumer.ConsumerConfig] (ServerService Thread Pool -- 76) The configuration ssl.keystore.type = JKS was supplied but isn't a known config.
      14:45:33,841 WARN  [org.apache.kafka.clients.consumer.ConsumerConfig] (ServerService Thread Pool -- 76) The configuration ssl.trustmanager.algorithm = PKIX was supplied but isn't a known config.
      14:45:33,841 WARN  [org.apache.kafka.clients.consumer.ConsumerConfig] (ServerService Thread Pool -- 76) The configuration sasl.kerberos.min.time.before.relogin = 60000 was supplied but isn't a known config.
      14:45:33,841 WARN  [org.apache.kafka.clients.consumer.ConsumerConfig] (ServerService Thread Pool -- 76) The configuration ssl.protocol = TLS was supplied but isn't a known config.
      14:45:33,841 WARN  [org.apache.kafka.clients.consumer.ConsumerConfig] (ServerService Thread Pool -- 76) The configuration ssl.enabled.protocols = TLSv1.2,TLSv1.1,TLSv1 was supplied but isn't a known config.
      14:45:33,841 WARN  [org.apache.kafka.clients.consumer.ConsumerConfig] (ServerService Thread Pool -- 76) The configuration ssl.truststore.type = JKS was supplied but isn't a known config.
      14:45:33,841 WARN  [org.apache.kafka.clients.consumer.ConsumerConfig] (ServerService Thread Pool -- 76) The configuration ssl.keymanager.algorithm = SunX509 was supplied but isn't a known config.
      

      Thanks!

      Attachments

        1. kafkaThreadStack.png
          105 kB
          Jose Luis Pedrosa

        Activity

          People

            acosentino Andrea Cosentino
            jlpedrosa Jose Luis Pedrosa
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: