Oops. Yes, the QPID java client against the QPID CPP broker handles this. On Thu, May 28, 2009 at 10:32 AM, Martin Ritchie <ritch...@apache.org>wrote:
> 2009/5/28 Walter Sobjak <wsobj...@gmail.com>: > > Thanks for the reply. > > Ah, I did not know that was not JMS compliant; that being said, this test > > case works against every JMS implementation I've tried it against. When > I > > fix the ordering, it works as expected. > > I do recall the Java client auto starting the connection on the first > call to receive() but I think we took that out as it was not strictly > JMS compliant. I'll try and find some time to see what your test case > is doing and why it doesn't work as you expected. > > > This was with the QPID Java Client with the QPID Java Broker. The QPID > CPP > > client appears to handle this. This is with Sun's Java6 implementation > on > > Fedora9. I believe I also tried this with Sun's Java5 and JRockit's > Java5. > > When you say the 'CPP client' do you mean the Java client to the cpp > broker? > Cheers > Martin > > > > On Fri, May 22, 2009 at 9:01 AM, Martin Ritchie <ritch...@apache.org> > wrote: > > > >> 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 > >> > >> > > > > > > -- > Martin Ritchie > > --------------------------------------------------------------------- > Apache Qpid - AMQP Messaging Implementation > Project: http://qpid.apache.org > Use/Interact: mailto:users-subscr...@qpid.apache.org > >