On Wed, Feb 18, 2009 at 7:19 PM, Rafael Schloming <[email protected]> wrote:

> 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.

I think that should be OK, I don't see why using a the same session to
send and receive messages should be a problem. A patch with this as a
QpidTestCase would be worth having.

- Aidan
-- 
Apache Qpid - World Domination through Advanced Message Queueing
http://qpid.apache.org

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

Reply via email to