activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Vincent <>
Subject RE: JMS application's consumer(with msg selector) not getting messages
Date Wed, 15 Dec 2010 17:03:50 GMT
> 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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message