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 » MQOPEN returned MQCC_OK when queue does not exist !?!

Post new topic  Reply to topic
 MQOPEN returned MQCC_OK when queue does not exist !?! « View previous topic :: View next topic » 
Author Message
warelock
PostPosted: Wed Aug 04, 2010 5:19 pm    Post subject: MQOPEN returned MQCC_OK when queue does not exist !?! Reply with quote

Novice

Joined: 18 Jun 2010
Posts: 19

I've got a strange problem ... but, aside from that, I am hoping someone here can help me with a code issue

I am opening a set of queues with this code

Code:

int openOutputQueues( MQHCONN Hcon,
                     MQOD outputQueueObjDesc[6],
                 MQHOBJ  hOutputQueueObj[6],
                 MQLONG  outputQueueOpenCode[6],
                 char*   outputQueueName[6],
                 char*   outputQueueManagerName[6] )
{
  int    x;
  int    success;
  MQLONG Reason;
  char   logMessage[512];

  success = 1;

  for(x=0; x<6; x++)
  {
    strncpy( outputQueueObjDesc[x].ObjectName,     outputQueueName[x],        (size_t)MQ_Q_NAME_LENGTH );
   strncpy( outputQueueObjDesc[x].ObjectQMgrName, outputQueueManagerName[x], (size_t)MQ_Q_MGR_NAME_LENGTH );

     MQOPEN(Hcon,                                 
            &outputQueueObjDesc[x],                       
            MQOO_OUTPUT | MQOO_FAIL_IF_QUIESCING,
            &hOutputQueueObj[x],                     
            &outputQueueOpenCode[x],                       
            &Reason);                             

        if( (outputQueueOpenCode[x] != MQCC_OK) || (Reason != MQRC_NONE) )
        {
          sprintf(logMessage,
               "MQOPEN for queue %s for queue manager %s ended with completion code %d and reason code %d.",
               outputQueueName[x],
               outputQueueManagerName[x],
              outputQueueOpenCode[x],
              Reason);
          logError( logMessage );
        success = 0;
        break;
        }
       else
       {
          sprintf(logMessage,
               "MQOPEN for queue %s for queue manager %s succeeded.",
              outputQueueName[x],
              outputQueueManagerName[x]);
          logThis(logMessage);
       }

        if (outputQueueOpenCode[x] == MQCC_FAILED)
        {
          sprintf(logMessage, "Unable to open queue %s for publish.", outputQueueName[x] );
        logError( logMessage );
        success = 0;
        break;
        }
  }

  return(success);


where the outputQueueName array is defined like this:

Code:

   char*   outputQueueName[6] = {"XL.PURCHASE.ORDER.Q0",
                                  "XL.PURCHASE.ORDER.Q1",
                                  "XL.PURCHASE.ORDER.Q2",
                                  "XL.PURCHASE.ORDER.BAD",
                                  "XL.PURCHASE.ORDER.Q4",
                                               "XL.PURCHASE.ORDER.ERROR.Q" };


I am settting the queue manager name with this code
Code:

   strncpy( outputQueueObjDesc[x].ObjectQMgrName, outputQueueManagerName[x], (size_t)MQ_Q_MGR_NAME_LENGTH );

because I am opening queues on a remote queue manager.

The queue XL.PURCHASE.ORDER.BAD does not exist. However, my code does not return any errors when I open that queue ! Later, when I use MQPUT to publsih to that queue, I not receive an error. However, the message I try to publish is lost (I can't find it, anyway).

When I supply all valid queue names, the code works correctly - i can publish messages to the queues i want to publish them to.

How can I detect an error when opening a bad queue name on a remote queue manager? I asume I am making some obvious error .. but I can't figure this out so far.

I'd appreciate any help - thanks !!

Ethan[/code]
Back to top
View user's profile Send private message
mvic
PostPosted: Wed Aug 04, 2010 5:59 pm    Post subject: Re: MQOPEN returned MQCC_OK when queue does not exist !?! Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

What is the logged output from the app, as far as this routine is concerned?
Back to top
View user's profile Send private message
warelock
PostPosted: Wed Aug 04, 2010 6:27 pm    Post subject: log output Reply with quote

Novice

Joined: 18 Jun 2010
Posts: 19

mvic, i see this:

Code:

20100804193451 - SAMPLE_RMS_PO_Info DEBUG - MQCONN to queue manager ISWMQ19T succeeded.
20100804193451 - SAMPLE_RMS_PO_Info DEBUG - MQOPEN for queue XL.PURCHASE.ORDER.Q0 for queue manager QKST succeeded.
20100804193451 - SAMPLE_RMS_PO_Info DEBUG - MQOPEN for queue XL.PURCHASE.ORDER.Q1 for queue manager QKST succeeded.
20100804193451 - SAMPLE_RMS_PO_Info DEBUG - MQOPEN for queue XL.PURCHASE.ORDER.Q2 for queue manager QKST succeeded.
20100804193451 - SAMPLE_RMS_PO_Info DEBUG - MQOPEN for queue XL.PURCHASE.ORDER.BAD for queue manager QKST succeeded.
20100804193451 - SAMPLE_RMS_PO_Info DEBUG - MQOPEN for queue XL.PURCHASE.ORDER.Q4 for queue manager QKST succeeded.
20100804193451 - SAMPLE_RMS_PO_Info DEBUG - MQOPEN for queue XL.PURCHASE.ORDER.ERROR.Q for queue manager QKST succeeded.


... showing that XL.PURCHASE.ORDER.BAD was opened succesfully. Later when I use MQOUT to write to the queue i see this:

Code:

20100804193451 - SAMPLE_RMS_PO_Info DEBUG - MQPUT to queue XL.PURCHASE.ORDER.BAD succeeded.


Finally when i close the queue i see this:

Code:

20100804193501 - SAMPLE_RMS_PO_Info DEBUG - MQCLOSE of queue XL.PURCHASE.ORDER.BAD suceeded.


I am wondering if the local queue manager has any way of knowing about queue names on the remote queue manager ?
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Aug 04, 2010 6:45 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

Quote:
How can I detect an error when opening a bad queue name on a remote queue manager? I asume I am making some obvious error .. but I can't figure this out so far.

If you specify the queue manager name in the MQOD, the next MQOPEN will not drive name resolution. The next MQPUTs will end up placing the messages in an xmit queue with the same name as the queue manager your MQOD specified.
_________________
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
View user's profile Send private message
warelock
PostPosted: Wed Aug 04, 2010 6:51 pm    Post subject: ok Reply with quote

Novice

Joined: 18 Jun 2010
Posts: 19

bruce2359 ... Oh, I see. Hm ... does that mean that there is no way to tell if I can connect to a specific remote queue ?
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Aug 04, 2010 7:11 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

Not really. WMQ distributed queuing is store-and-forward. The application is disengaged from the remote qmgr and remote queue.

Presuming that your app is not a client-connection app, what connects the two qmgrs is a point-to-point channel. Following MQOPEN of a QRemote definition, MQPUTs go to the transission queue, and the app receives success ReasonCode and CompletionCode. It is up to the channel to move the messages down the network.

The channel can be inactive, actively transmitting messages, retrying (after a network failure), or stopped after all retires have failed. The message will sit safely in the transmission queue until it is transmitted to the other end of the channel.

Once the message arrives on the downstream qmgr, the message may end up in the destination queue or the dead-letter queue.

In the usual request-reply scenario, the requesting app will MQGET with WAIT on the reply-to-queue for the reply message from the downstream app. The presence of the reply-message indicates that the whole request-reply app worked successfully. A well-discussed (and well pooh-poohed) alternative is the use of COA and COD messages.
_________________
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
View user's profile Send private message
warelock
PostPosted: Wed Aug 04, 2010 7:31 pm    Post subject: thanks ! Reply with quote

Novice

Joined: 18 Jun 2010
Posts: 19

Thanks bruce2359 ! That makes sense ... I've been trying to find out more about thisin the Programming Guide and Programming Reference , but i still have not run into it. Appreciate your advice !
Back to top
View user's profile Send private message
warelock
PostPosted: Wed Aug 04, 2010 7:40 pm    Post subject: got it Reply with quote

Novice

Joined: 18 Jun 2010
Posts: 19

AH, i see it - this is mentioned on page 99 of the Application Programming Guide:

<<Only local names are validated when you call MQOPEN...>>

in the section "Opening remote queues".
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 API Support » MQOPEN returned MQCC_OK when queue does not exist !?!
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.