You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Martin Haslinger (JIRA)" <ji...@apache.org> on 2008/11/05 15:31:06 UTC

[jira] Created: (AMQ-1995) Exception "The Consumer is closed" in multithreaded environment

Exception "The Consumer is closed" in multithreaded environment
---------------------------------------------------------------

                 Key: AMQ-1995
                 URL: https://issues.apache.org/activemq/browse/AMQ-1995
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker
    Affects Versions: 5.2.0, 5.1.0
         Environment: Windows XP, JRE 1.5.0_12, 2GB Memory, Dual-core
            Reporter: Martin Haslinger


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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-1995) Exception "The Consumer is closed" in multithreaded environment

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1995?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=47081#action_47081 ] 

Gary Tully commented on AMQ-1995:
---------------------------------

good catch. this is a bug in the test, each Producer should have its own session as a session is only intended for use by a single tread at a time as per the JMS spec.
I am running a quick sanity check on the changes as I type. 

> Exception "The Consumer is closed" in multithreaded environment
> ---------------------------------------------------------------
>
>                 Key: AMQ-1995
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1995
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.1.0, 5.2.0
>         Environment: Windows XP, JRE 1.5.0_12, 2GB Memory, Dual-core
>            Reporter: Martin Haslinger
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AMQ-1995) Exception "The Consumer is closed" in multithreaded environment

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-1995?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Tully resolved AMQ-1995.
-----------------------------

    Fix Version/s: 5.3.0
       Resolution: Fixed

problem with the test code, it was not thread safe.
resolved in r711617.

> Exception "The Consumer is closed" in multithreaded environment
> ---------------------------------------------------------------
>
>                 Key: AMQ-1995
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1995
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.1.0, 5.2.0
>         Environment: Windows XP, JRE 1.5.0_12, 2GB Memory, Dual-core
>            Reporter: Martin Haslinger
>            Assignee: Gary Tully
>             Fix For: 5.3.0
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (AMQ-1995) Exception "The Consumer is closed" in multithreaded environment

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-1995?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Tully reassigned AMQ-1995:
-------------------------------

    Assignee: Gary Tully

> Exception "The Consumer is closed" in multithreaded environment
> ---------------------------------------------------------------
>
>                 Key: AMQ-1995
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1995
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.1.0, 5.2.0
>         Environment: Windows XP, JRE 1.5.0_12, 2GB Memory, Dual-core
>            Reporter: Martin Haslinger
>            Assignee: Gary Tully
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.