|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
JMS MessageListener multithreaded under MQ? |
« View previous topic :: View next topic » |
Author |
Message
|
brendan |
Posted: Sun Mar 17, 2002 6:05 pm Post subject: |
|
|
Newbie
Joined: 23 Feb 2002 Posts: 5
|
Hi,
does anyone know whether the IBM MQSeries implementation of the JMS MessageListener is multi-threaded or not? What I mean is, does MQ start up a new thread for each message received, from which it then calls onMessage(), or does it have a single thread from which it calls onMessage(), blocking on it's return before checking for/retrieving the next message? Couldn't find any information on this in the documentation.
Thanks,
Brendan.
|
|
Back to top |
|
 |
kolban |
Posted: Sun Mar 17, 2002 6:19 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
That's a very good question ... one that should be pretty straightforward. I would be VERY dissapointed in a message listener onMessage() was not multi-threaded. I would hope that each Session's messageListener would be independent from each others. However, a message listener associated with a particular Session should not cause two onMessages() to be invoked per session, even if two queueReceivers associated with a session were ready. |
|
Back to top |
|
 |
brendan |
Posted: Sun Mar 17, 2002 6:57 pm Post subject: |
|
|
Newbie
Joined: 23 Feb 2002 Posts: 5
|
So you are saying that the processing for a single MessageListener is not multi-threaded? As in the next message will not be read off the queue until the call to onMessage() returns? |
|
Back to top |
|
 |
kolban |
Posted: Sun Mar 17, 2002 8:16 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
I consulted the JMS Spec ... Section 4.4 on Sessions ...
A Session serves several purposes ....
o ...
o It serializes execution of MessageListeners registered with it.
See also 4.4.6 - Conventions for Using a Session
See also 4.4.14 - Serial Execution of Client Code
"In effect, a Session uses a single thread to run all its MessageListeners. While the thread is busy executing one listener, all other messages to be asynchonrously delievered to the session must wait".
So ... all this said ... I think the answer is clear.
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|