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 API Support » MQGET/MQPUT Timeouts

Post new topic  Reply to topic
 MQGET/MQPUT Timeouts « View previous topic :: View next topic » 
Author Message
ali
PostPosted: Tue May 06, 2003 1:42 pm    Post subject: MQGET/MQPUT Timeouts Reply with quote

Newbie

Joined: 06 May 2003
Posts: 4

If I am issuing an MQGET or an MQPUT in a loop continously,
and a network error happens(e.g., cable unplugged), what
is default behavior with no error handling in the application?

Currently its hangs for long period of time. Is there a way to find
out right way with simple GET/PUT for any error conditions or do
I need to build application logic to handle that?

Thanks
Ali
Back to top
View user's profile Send private message
kolthorr
PostPosted: Tue May 06, 2003 5:06 pm    Post subject: Timeouts Reply with quote

Apprentice

Joined: 09 Mar 2002
Posts: 31

Hi Ali,

Specifying the MQGMO_WAIT option, and also setting the Get Message Options Timeout field will cause the call to fail once no messages are available for that amount of time. Some sample C code:
Code:

MQGMO   gmo = {MQGMO_DEFAULT};   /* get message options */
gmo.Options = MQGMO_WAIT      /* wait for new messages */
  + MQGMO_ACCEPT_TRUNCATED_MSG   /* remove long messages  */
  + MQGMO_FAIL_IF_QUIESCING    /* or until MQM stopping */
  + MQGMO_CONVERT;      /* convert if necessary  */
gmo.WaitInterval = 10000; /* 10 seconds, value is in ms */

Then use that 'gmo' variable in your MQGET call.
I suspect there is something similar for the MQPUT. Make sure you specify fail if quiescing for both.
If the network itself is disappearing you might receive a return code of 2009 (CONNECTION_BROKEN).

Hope this helps. Regards,
Andrew
Back to top
View user's profile Send private message
Keka
PostPosted: Tue May 06, 2003 8:18 pm    Post subject: Reply with quote

Voyager

Joined: 28 Dec 2002
Posts: 96

I am not sure if I got your question right.. But I think you are asking 2 things..
1. How long you should wait for the message in the queue while doing a get operation.. If so, Andrew's explanation answers that..
2. What happens if a put operation is done and a network failure happnes..
MQ hides the network from the application and even if the channel is down due to a network failure, your put operation will succeed.. There is no wait time while doing a put operation as it will always return with success as long as the Queue you are trying to put your message to. exists.. If the message is non-persistent and the network failure occurs (i.e channel goes down) during transit, you will lose the message. The only way to know if the message reached destination is not is to put a request messagte and wait for a reply or a report..

Hope this helps
_________________
Keka
Back to top
View user's profile Send private message
JohnMN
PostPosted: Wed May 07, 2003 6:34 am    Post subject: Reply with quote

Novice

Joined: 26 Feb 2003
Posts: 19

Keka wrote:
If the message is non-persistent and the network failure occurs (i.e channel goes down) during transit, you will lose the message. The only way to know if the message reached destination is not is to put a request messagte and wait for a reply or a report..
Hope this helps


I disagree with this part of your answer.

The channel does not consider the message to be "delivered" until the receiving side has acknowledged that it has received the full message.

If a channel goes down, the message will remain on the trasmit queue until it can be retried.

Non-persistent messages will be removed from the transmit queue if the Queue Manager terminates.

John
Back to top
View user's profile Send private message
Keka
PostPosted: Wed May 07, 2003 7:06 am    Post subject: Reply with quote

Voyager

Joined: 28 Dec 2002
Posts: 96

Thanks for the correction.. You are right.
_________________
Keka
Back to top
View user's profile Send private message
ali
PostPosted: Wed May 07, 2003 10:51 am    Post subject: Reply with quote

Newbie

Joined: 06 May 2003
Posts: 4

I'll clarify little bit.

MQPUT/GET are at application layers. OS is not giving notification that connection is broken. On TPF environment, OS gives no notification. On AIX, the notification comes after 5 minutes.

Timeout interval is only used for retrying. With a restraint that application is single threaded, how would you deal with this situation?

Thanks
Ali
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Wed May 07, 2003 9:29 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

JohnMN, you are missing a piece to complete your answer.

If the Server Channel has the NPMSPEED(FAST) attribute set and the channel hiccups (for whatever reason) while transmitting a non-persistent message then that particular message can / will be thrown away (discarded).

later
Roger...
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » MQGET/MQPUT Timeouts
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.