|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
JMS receive() method |
« View previous topic :: View next topic » |
Author |
Message
|
sam |
Posted: Tue Apr 30, 2002 11:23 am Post subject: |
|
|
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 |
|
 |
kolban |
Posted: Tue Apr 30, 2002 4:50 pm Post subject: |
|
|
 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 |
|
 |
sam |
Posted: Wed May 01, 2002 8:33 am Post subject: |
|
|
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 |
|
 |
|
|
 |
|
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
|
|
|
|