Rajith Attapattu wrote:
Aidan,

I came across this when I wrote a simple test to figure out another issue.
Basically I did the following.

create connection
start the connection
create a session
create a destination, using that create a MC and a MP.
set a MessageListener to the MC.
send messages using MP.

When the session tries to deliever the messages it throws an
IllegalStateException as the dispatcher thread is null.

Let me create a JIRA and then attach the test case and the stack trace.

Strictly speaking I believe the JMS api-doc says that the behavior in the above scenario is undefined. From the api-doc:

"The effect of calling MessageConsumer.setMessageListener while messages are being consumed by an existing listener or the consumer is being used to consume messages synchronously is undefined."

I think this means that throwing an IllegalStateException is valid, however that doesn't mean we can't do something a bit more graceful if we want to.

--Rafael


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to