multiple consumers in a Queue
843830Apr 25 2002 — edited May 23 2002Hi
I would like to be able to potentially increase throughput of message consumption by adding multiple consumers (plain MessageListeners, not MDBs) to a single queue, with each consumer created off its own session.
The JMS spec 1.0.2b is controversial IMO
"It should be natural for most clients to partition their work into sessions. This
model allows clients to start simply and incrementally add message processing
complexity as their need for concurrency grows." (4.4.6)
"Clients that desire concurrent delivery can use multiple sessions. In effect, each
session�s listener thread runs concurrently. While a listener on one session is
executing, a listener on another session may also be executing." (4.4.15)
BUT
"For PTP, JMS does not specify the semantics of concurrent QueueReceivers for
the same queue; however, JMS does not prohibit a provider from supporting
this." (4.4.9)
"Although it is possible to have two sessions with a QueueReceiver for the same
queue, JMS does not define how messages are distributed between the
QueueReceivers." (5.8)
my own tests with the J2EE 1.3 RI show that :
1) each listener gets exactly one message and will not get another until it is done with it
2) different listeners are invoked concurrently
so effectively, multiple sessions with one listener each increase concurrency.
this behavior is ok for me - but that's the RI.
Has anyone any experience on this about other implementations ?
Edo