2009/5/13 Walter Sobjak <wsobj...@gmail.com>:
> Hello
>
> I believe I may have uncovered a possible concurrency issue with the way
> the Java Broker and/or Client works.  It appears if a message consumer
> is awaiting a message in receive() before its connection is started, it
> is never able to pull from its queue.
>
> I have attached a sample bit of code that hopefully displays this.  In
> it, I create a temp queue and consumer from a session.  Then I create a
> sub-thread that creates a producer, sends a message, then tries to
> manually have the consumer pull from that queue using cons.receive().
>
> I start the thread, sleep for 2s, and then start the connection.  The
> consumer hangs while trying to receive the message.  According to JMX,
> the temp queue I create has both a consumer and a message before I start
> the sub-thread.
>
> This is against the M4 versions of the Java Broker and client; I have
> also tried the first 0.5 release candidate.
>
> Thanks
>
> WS
>
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscr...@qpid.apache.org
>

I shall try and find some time to run your test case however what you
are doing is not JMS compliant.

You should start the connection BEFORE attempting to call receive().

That said I'll need to run your test app to see what is gong on as I
would have thought that starting afterwards should work.

Were you using the matching Java broker in your test? Not that it
should matter but just so that I can reproduce more accurately what
you are doing.

Also just in case it matters what JVM and OS are you using?

Cheers

Martin



-- 
Martin Ritchie

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscr...@qpid.apache.org

Reply via email to