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 receive() method

Post new topic  Reply to topic
 JMS receive() method « View previous topic :: View next topic » 
Author Message
sam
PostPosted: Tue Apr 30, 2002 11:23 am    Post subject: Reply with quote

Acolyte

Joined: 02 Apr 2002
Posts: 52

Which one is more efficient, recieve() which is a blocking call or recieve(timeout) with a timeout specified. I mean which call do I use if I'm working in a Request/Reply scenario? Thanks for any input.
Back to top
View user's profile Send private message
kolban
PostPosted: Tue Apr 30, 2002 4:50 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

Just from a functionality perspective, I would use receive plus timeout. Remember, in asynchronous messaging, it is assured that the message will arrive but not when. It is unlikely that you would want a reply if it arrived too late (minutes, hours, days, weeks ...)

Back to top
View user's profile Send private message
sam
PostPosted: Wed May 01, 2002 8:33 am    Post subject: Reply with quote

Acolyte

Joined: 02 Apr 2002
Posts: 52

Kolban,
Thanks for the input. If I'm waiting for a bunch of messages with a timeout set to 5000 milliseconds, I'll still be waiting in the while loop after the timeout right? In other words my code looks something like this.

while(true) {
Message m = MQQueueReciever.recieve(5000);
if(message == null)
continue;
else if Message.equals("LAST MESSAGE");
break;

I mean what is the difference between this and a listener which will deliver the messages asychronously? Which one is more efficine and why? Thanks for the input, appreciate your time.



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 receive() method
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.