0

I am writing a C# application which reads a message from a queue on one QueueManager but potentially needs to write the response to a queue on a different queue manager. The QueueManager and QueueName to use for the response are defined as properties of the MQ Request message. Both QueueManagers are hosted by the same WebSphere MQ environment. i.e. What I need to do is use the same QueueManager instance that I used to read the request to write the reply (there may be many combinations of QueueManager/QueueName to write the response)

When building the response I have code of the form:

var ResponseQueue = RequestQueueManager.AccessQueue(RequestMessage.ReplyToQueueName, MQC.MQOO_OUTPUT,
                    RequestMessage.ReplyToQueueManagerName, null, null);

If the response queue manager is the same as the request queue manager, this all works, but if the responsequeue manager is different I get the error MQRC_UNKNOWN_REMOTE_Q_MGR, CompCode: 2, Reason: 2087.

I did find an article which suggested that I needed to set the MQOD properties of the response queue manager

MQOD.ObjectName=ResponseQueueName
MQOD.ObjectQMgrName= ResponseQueueManagerName

but I can't see how to do this in C#.

Any help would be much appreciated.

1
  • Are your queue managers - the one you are getting request message and the one where you want to send the response to are connected - either using sender/receiver channel pairs or MQ Cluster channels? Also the TransmitQueue Name for the sender channel is set as the name of the queue manager where you want to send the response. Please see here for details of MQRC 2087 - ibm.com/docs/en/ibm-mq/…
    – Shashi
    Commented Aug 29 at 15:55

2 Answers 2

0

Your code looks OK.

But you will get that return code if your queue manager has not got a route defined back to the remote qmgr. So a suitable transmission queue at minimum. And then a channel to actually move the message.

So you need to work with your qmgr administrator to ensure all the definitions are in place.

0

Thanks Mark - I found the problem was that I had to Trim() the queue manager and queue names otherwise they were not found.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.