|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Error handling after each MQ API call |
« View previous topic :: View next topic » |
Author |
Message
|
ydsk |
Posted: Fri Mar 16, 2007 10:16 am Post subject: Error handling after each MQ API call |
|
|
Chevalier
Joined: 23 May 2005 Posts: 410
|
Hi,
We have more than 200 C/C++ Windows clients connecting to a single MQ qmgr on AIX.
All the clients do a PUT to a queue X, and then indefinitely wait and do a GET from the other queue Y on the AIX qmgr.
The same exact code runs on all the 200 + clients. I don't have any threading issues - all are single threaded.
I am looking for some guidance / samples on handling errors immediately after an API call , in fact after every MQ API call in the C/C++ client.
I think we first check for the Completion Code CC, and then the Reason Code RC after every API call.
Just before opening queue X, the OPEN OPTIONS we gave are:
MQOO_OUTPUT + MQOO_FAIL_IF_QUIESCING
Just before opening queue Y, the OPEN OPTIONS we gave are:
MQOO_INPUT_SHARED + MQOO_FAIL_IF_QUIESCING
After each of the MQOPEN calls above we are planning to do a check as follows:
if ( CC == MQCC_FAILED)
if (RC == ..... )
My questions are:
(1) Is it enough if I check for CC == MQCC_FAILED ?? Or do I need to check for any other completion codes ?
(2) What all RC values do I need to check ? I think there are too many of them, and I am not sure which ones to check for. Pls help.
Again, after the OPEN calls, we are doing a PUT to queue X without any explicit PutMessageOptions - using the defaults.
Later we are doing a GET from queue Y with these GetMessageOptions:
MQGMO_WAIT | MQGMO_FAIL_IF_QUIESCING
My questions here again are:
(3) Do I need to use any other PUT/GET message options here ?? I think it depends on the specific application but I am looking for some general guideline.
(4) Do I need to do the same error checking with CC and RC here ? Can somebody please suggest the different values of CC and RC for PUT / GET ?
Appreciate any links ( to any sections of Appl prog guide / reference ) or any other suggestions from your experience.
Thanks in advance.
regds,
ydsk. |
|
Back to top |
|
 |
dhanaraj |
Posted: Fri Mar 16, 2007 10:42 am Post subject: |
|
|
 Voyager
Joined: 10 Aug 2004 Posts: 92
|
1.CC == MQCC_FAILED i think its enough for checking the cc
ex: if (OpenCode == MQCC_FAILED) {
printf("XXXXXXXXXXXX \n");
}
2. you have to display the RC like
if (Reason != MQRC_NONE) {
printf("XXXXXXXXXXX reason code %ld\n", Reason);
}
3. MQGMO_DEFAULT
4. Yes
I think these ans may helpful for you.
Thanks
Anand |
|
Back to top |
|
 |
Vitor |
Posted: Mon Mar 19, 2007 1:06 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
There are some reason codes which may require special handling. For instance 2033 is a message not found exception, while despite being a failure may simply indicate a) your programme's finished or b) you need to wait a bit longer. Another example is 2009 (client connection gone funny) which indicates your program needs to reestablish connecivity.
My tip - search the forum for reason code discussions. Make sure your code correctly handles the commonly discussed ones. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
tleichen |
Posted: Wed Mar 21, 2007 7:04 am Post subject: |
|
|
Yatiri
Joined: 11 Apr 2005 Posts: 663 Location: Center of the USA
|
Also, if you check for CC==MQCC_FAILED, this leaves out the return codes that are classified as MQCC_WARNING! IMHO, you should code for CC != MQCC_OK. And as Vitor pointed out, some individual codes need to be dealt with. _________________ IBM Certified MQSeries Specialist
IBM Certified MQSeries Developer |
|
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
|
|
|
|