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.
Problem description:
O/S: 7.3, MQ version: 8.0.0.5. The server is in a Enclave.
A queue manager exists with a Server-connection channel named
CL_IR360. The user is trying to connect to it, however, it is failing
with the below error.
Error message user is getting:
The error above in this particular case was due to the fact that there was no channel authority (SET CHLAUTH) setting to the Server-connection channel. A channel authority was added and the error was resolved.
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 isI 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:
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)
Please do not use MQEnvironment class as it is not thread safe. It is far better to put all the information in a Hashtable and pass the Hashtable to the MQQueueManager class. Here is a MQ .NET managed-mode example using a Hashtable for MQ connection information: