Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MQ error 2085 while connecting with remote queue

Tags:

c#

ibm-mq

My .NET code can connect and put a message to a remote queue successfuly. However, the same code does not work with local queue. It throws 2085 error. What different setting should be set in code to make that work with local queue?

Here is my code:

Hashtable queueProperties = new Hashtable();
queueProperties[MQC.HOST_NAME_PROPERTY] = "10.x.x.x";
queueProperties[MQC.PORT_PROPERTY] = 1451;
queueProperties[MQC.CHANNEL_PROPERTY] = "TST1.TRADE.CHANNEL";

try
{
    // Attempt the connection
    queueManager = new MQQueueManager("MYQUEUEMANAGER", queueProperties);
    strReturn = "Connected Successfully";
}
catch (MQException mexc)
{
    // TODO: Setup other exception handling
    throw new Exception(mexc.Message
               + " ReasonCode: " + mexc.ReasonCode
               + "\n" + GetReason(mexc.ReasonCode), mexc);
}

Here, the code is internally using the IIS user id (application pool user) to connect with MQ because this code is run as part of WCF service.

like image 496
Anil Soman Avatar asked Jul 13 '17 12:07

Anil Soman


1 Answers

If you run the mqrc utility you can find out what the error code translates to:

$mqrc 2085

      2085  0x00000825  MQRC_UNKNOWN_OBJECT_NAME

This means the queue name you are attempting to open does not exist on the queue manager you are connected to.

I noted that the source you posted does not include any code related to opening the queue. You should check that the queue name you are attempting to open does in fact exist on the queue manager you are connecting to.

like image 196
JoshMc Avatar answered Oct 12 '22 21:10

JoshMc