|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQOPEN: MQOPEN ended with reason code 0 |
« View previous topic :: View next topic » |
Author |
Message
|
4d1in3 |
Posted: Thu Apr 11, 2013 7:58 pm Post subject: MQOPEN: MQOPEN ended with reason code 0 |
|
|
Newbie
Joined: 09 Apr 2013 Posts: 4
|
while trying to open the MQ queue, my program is returning
Quote: |
MQOPEN ended with reason code 0 |
below the code which opens the MQ. What is the impact when Reason!=MQRC_NONE. Also during execution OpenCode is not failed.
Currently what happens is, while sending messages, its not reaching queue.
while putting message in the queue also it returns
Quote: |
MQPUT ended with reason code 0. |
Can anyone explain why is this happening?
My program is running in Aix 6.1 machine.
Quote: |
[dev@batch]$dspmqver
Name: WebSphere MQ
Version: 7.5.0.0
Level: p000-L120604
BuildType: IKAP - (Production)
Platform: WebSphere MQ for AIX
Mode: 64-bit
O/S: AIX 6.1
InstName: Installation1
InstDesc:
InstPath: /usr/mqm
DataPath: /var/mqm
Primary: Yes
MaxCmdLevel: 750
|
-------
code for opening the Queue is below
Code: |
O_options = MQOO_OUTPUT /* open queue for output */
| MQOO_FAIL_IF_QUIESCING /* but not if MQM stopping */
; /* = 0x2010 = 8208 decimal */
MQOPEN(.....);
if (Reason != MQRC_NONE)
printf("MQOPEN ended with reason code %d\n", Reason);
if (OpenCode == MQCC_FAILED)
printf("unable to open queue for output\n");
....
MQPUT(Hcon, /* connection handle */
Hobj, /* object handle */
&md, /* message descriptor */
&pmo, /* default options (datagram) */
messlen, /* message length */
buffer, /* message buffer */
&CompCode, /* completion code */
&Reason); /* reason code */
/* report reason, if any */
if (Reason != MQRC_NONE) {
printf("MQPUT ended with reason code %d\n", Reason);
}else
printf("MQPUT successfull");
}
|
|
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Apr 11, 2013 9:24 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Go to google. Search for MQRC_NONE. What does your research tell you about MQRC_NONE?
What does not failed mean to you? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
4d1in3 |
Posted: Thu Apr 11, 2013 10:12 pm Post subject: |
|
|
Newbie
Joined: 09 Apr 2013 Posts: 4
|
I'm confused about the return code.
value of MQRC_NONE is '0', but when I print the value of reason it is also 0.
it should not enter
if (Reason != MQRC_NONE)
printf("MQOPEN ended with reason code %d", Reason);
but value printed is 0, |
|
Back to top |
|
 |
rekarm01 |
Posted: Fri Apr 12, 2013 1:43 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
4d1in3 wrote: |
it should not enter
Code: |
if (Reason != MQRC_NONE)
printf("MQOPEN ended with reason code %d\n", Reason); |
|
What is the declared type for Reason? It should be MQLONG. |
|
Back to top |
|
 |
4d1in3 |
Posted: Sun Apr 14, 2013 8:19 pm Post subject: |
|
|
Newbie
Joined: 09 Apr 2013 Posts: 4
|
It is declared as MQLONG. |
|
Back to top |
|
 |
gbaddeley |
Posted: Mon Apr 15, 2013 6:19 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
Code: |
if (Reason != MQRC_NONE)
printf("MQOPEN ended with reason code %d\n", Reason); |
Very strange. Try coding some diagnostics:
Code: |
MQOPEN(.....)
printf("MQOPEN returned CompCode=%d Reason=%d\n", CompCode, Reason );
if (Reason != MQRC_NONE)
printf("MQOPEN ended with reason code %d\n", Reason); |
I doubt that %d is not printing a MQLONG as a 32 bit signed integer, or the printf is being executed even though the if ( ) should have failed, if ( 0 != 0 ). We need to dig a bit deeper to understand what is going on. _________________ Glenn |
|
Back to top |
|
 |
rekarm01 |
Posted: Tue Apr 16, 2013 12:09 am Post subject: Re: MQOPEN: MQOPEN ended with reason code 0 |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
4d1in3 wrote: |
it should not enter
Code: |
if (Reason != MQRC_NONE)
printf("MQOPEN ended with reason code %d", Reason); |
|
Is it possible that the posted code doesn't match what's running, or that the output in question is from a similar but separate printf?
What was the complete command used to compile the program, including compiler options, and library options?
To expand on gbaddelay's suggestion, try something like:
Code: |
printf("Reason = %ld, size = %lu, MQRC_NONE = %ld, size = %lu, boolean = %d\n",
(long) (Reason), sizeof (Reason), (long) (MQRC_NONE), sizeof (MQRC_NONE), Reason != MQRC_NONE); |
|
|
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
|
|
|
|