ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » JMS MessageListener multithreaded under MQ?

Post new topic  Reply to topic
 JMS MessageListener multithreaded under MQ? « View previous topic :: View next topic » 
Author Message
brendan
PostPosted: Sun Mar 17, 2002 6:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
kolban
PostPosted: Sun Mar 17, 2002 6:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
brendan
PostPosted: Sun Mar 17, 2002 6:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
kolban
PostPosted: Sun Mar 17, 2002 8:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » JMS MessageListener multithreaded under MQ?
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.