activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve.V." <>
Subject Re: JMS java client having trouble receiving with message selector
Date Wed, 15 Dec 2010 17:10:09 GMT

Gary Tully responded to my in the user forum and provide me with the info I
needed to find my mistake.  Below is the follow-up I sent to the user forum
describing my mistake.


> It does not poll the broker for messages unless prefetch is 0.


	Thank you Gary.  Not only does prefetch=0 allow me to get the messages, but
it also caused me to inspect my code given that new knowledge.  I now
realize I told a fib when I said I was only creating one consumer.  I had
forgotten that by default, I am creating a consumer without a message
selector.  Later, if my user wants a message and specifies a message
selector, I create a new consumer with the message selector. The creation of
that first plain consumer is causing my problem.  I assume the messages were
dispatched to it upon creation; such that when I subsequently create the
second consumer with the message selector, it doesn't see the messages that
were already dispatched to that first consumer.  The problem is circumvented
by setting prefetch=0, but I should should fix my app by refraining from
creating that first "default" consumer.  I assume my app and test case
worked when using WebSphere MQ because I assume no messages are being
dispatched to the consumer upon its creation.  I guess WebSphere MQ waits
until the first receive before dispatching messages. 

Thank you very much for reading my post and providing me with that valuable
info.  I sincerely appreciate it.


Stephen Vincent

View this message in context:
Sent from the ActiveMQ - Dev mailing list archive at

View raw message