I am new to IBM Websphere MQ
I am trying add messages to a Remote websphere MQ queue manager. I am getting following error while trying to connect to it.
Also, I have tried many possible solutions provided in forums like changing .net framework to 3.5 also I am getting good ping while I ping the remote machine but I am unable to connect to it using C# code. The queue manager listener is up and running, but this is the error I am getting
2538 - MQRC_HOST_NOT_AVAILABLE
while trying to do this.
queueManager = new MQQueueManager();
I am using .net framework 4.5. Any help would be appreciated.
MQRC_HOST_NOT_AVAILABLE
could mean that your client is unable to find the Queue Manager you have told it to look for. Given that you have said your code is
queueManager = new MQQueueManager();
I suspect you haven't told your .NET some key bits of information it needs to know to be able to find the Queue Manager. In order to connect a MQ Client to a Queue Manager, it needs to know the
For .NET these can be supplied in different ways which are detailed in the knowledge center doc on the MQQueueManager class.
From that page the example code to connect to a Queue Manager says:
MQEnvironment.hostname = "fred.mq.com"; // host to connect to
MQEnvironment.port = -1; // port to connect to. If not set, this defaults to 1414 for WebSphereMQ Client connections.
MQEnvironment.channel = "channel.name"; // the CASE-SENSITIVE name of the SVRCONN channel on the queue manager
MQQueueManager qMgr = new MQQueueManager("MYQM");
Also note that the call to create a MQQueueManager also takes a parameter which is the name of the Queue Manager connecting to.
Check that you are providing all of the necessary information that a client needs to connect including the name of the Queue Manager. If it is still failing then the check the Queue Manager's logs for any error messages (if there are none the Client really isn't getting to the Queue Manager otherwise the error message will say why the Queue Manager isn't responding)