Uploaded image for project: 'ActiveMQ'
  1. ActiveMQ
  2. AMQ-1995

Exception "The Consumer is closed" in multithreaded environment

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.1.0, 5.2.0
    • Fix Version/s: 5.2.0
    • Component/s: Broker
    • Labels:
      None
    • Environment:

      Windows XP, JRE 1.5.0_12, 2GB Memory, Dual-core

      Description

      I got the following exception when running the TempQueueMemoryTest and increasing number of producer, consumers and messages:

      javax.jms.IllegalStateException: The Consumer is closed
      at org.apache.activemq.ActiveMQMessageConsumer.checkClosed(ActiveMQMessageConsumer.java:699)
      at org.apache.activemq.ActiveMQMessageConsumer.getMessageListener(ActiveMQMessageConsumer.java:339)
      at org.apache.activemq.ActiveMQSession.checkMessageListener(ActiveMQSession.java:1864)
      at org.apache.activemq.ActiveMQMessageConsumer.checkMessageListener(ActiveMQMessageConsumer.java:717)
      at org.apache.activemq.ActiveMQMessageConsumer.receive(ActiveMQMessageConsumer.java:457)
      at TempQueueMemoryTest$1Producer.run(TempQueueMemoryTest.java:94)

      The error happens at "Message reply = consumer.receive();", the message is not received.

      I increased the number of consumers and produceres to 2 and the number of messages to 5000. When using larger numbers the exception is thrown more often (unpredictable how often exactly). It definitly seems to be a multithreading-related problem because it only happens with multiple threads producing/consuming and the more threads you have the more often it happens.

      Tested with 5.2 RC2.

        Attachments

          Activity

            People

            • Assignee:
              gtully Gary Tully
              Reporter:
              martinhasl Martin Haslinger
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: