Uploaded image for project: 'Metron (Retired)'
  1. Metron (Retired)
  2. METRON-891

KafkaConsumer should not be shared among threads

Details

    • Bug
    • Status: Done
    • Major
    • Resolution: Done
    • None
    • 0.4.0
    • None

    Description

      The KafkaConsumer is created as a Spring bean in the REST application and is causing this error to periodically show up in the logs:

      SEVERE: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.util.ConcurrentModificationException: KafkaConsumer is not safe for multi-threaded access] with root cause
      java.util.ConcurrentModificationException: KafkaConsumer is not safe for multi-threaded access
      at org.apache.kafka.clients.consumer.KafkaConsumer.acquire(KafkaConsumer.java:1431)
      at org.apache.kafka.clients.consumer.KafkaConsumer.listTopics(KafkaConsumer.java:1293)
      at org.apache.metron.rest.service.impl.KafkaServiceImpl.listTopics(KafkaServiceImpl.java:97)
      at org.apache.metron.rest.service.impl.KafkaServiceImpl.getSampleMessage(KafkaServiceImpl.java:107)
      at org.apache.metron.rest.controller.KafkaController.getSample(KafkaController.java:89)
      at sun.reflect.GeneratedMethodAccessor191.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
      at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
      at

      Attachments

        Activity

          People

            Unassigned Unassigned
            rmerriman Ryan Merriman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment