I have got the MQ Client running successfully and the messages are available using it.
WE have set up the necessary Environment variables: MQCHLLIB and MQCHLTAB and MQSSLKEYR.
The .TAB file is in the right folder. However when I execute the following code:
private static bool ConnectMq()
{
try
{
queueManager = new MQQueueManager("ECG_MBTST_QM", Init(false));
queueManager.Connect();
if (queueManager.IsConnected)
{
Console.WriteLine("Connected...");
}
return true;
}
catch (MQException exp)
{
Console.WriteLine("Exception Message: " + exp.Message);
}
catch (Exception exp)
{
Console.WriteLine("Exception: " + exp.Message);
}
return false;
}
private static Hashtable Init()
{
Hashtable properties;
properties = new Hashtable
{
{MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT}
};
return properties;
}
I get the error message as described. I have no choice but to use a CCDT file as that is what the server host has specified. I believe the server is v7 and I am referencing the v8 WMQ libraries. In theory this should work.
I have tried with using the standard set of properties as well (values have been altered for security purposes):
properties = new Hashtable
{
{MQC.TRANSPORT_PROPERTY, "TCP"},
{MQC.CHANNEL_PROPERTY, "Channel"},
{MQC.CONNECTION_NAME_PROPERTY, "IBM_MQ_Conn"},
{MQC.PORT_PROPERTY, "1414"},
{MQC.HOST_NAME_PROPERTY, "IP Address"},
{MQC.SSL_CIPHER_SPEC_PROPERTY, "TLS_RSA_WITH_AES_128_CBC_SHA"}
};
But when i use the above properties I get a 2538 error - Host not available. Is there something I am missing with regards to how to use the CCDT file and C# together?
Thanks in advance.
edit - as requested by JoshMC
This is the latest entry from the AMQERR01.LOG file:
1/18/2017 1:51:05 AM - Process(3272.1) User(andrewhuntley) Program( MQ app.exe)
AMQ9202: Remote host '192.168.150.102' not available, retry later.
EXPLANATION:
The attempt to allocate a conversation using TCP/IP to host '192.168.150.102'
for channel (Exception) was not successful. However the error may be a
transitory one and it may be possible to successfully allocate a TCP/IP
conversation later.
In some cases the remote host cannot be determined and so is shown as '????'.
ACTION:
Try the connection again later. If the failure persists, record the error
values and contact your systems administrator. The return code from TCP/IP is 0
(X'0'). The reason for the failure may be that this host cannot reach the
destination host. It may also be possible that the listening program at host
'192.168.150.102' was not running. If this is the case, perform the relevant
operations to start the TCP/IP listening program, and try again.
----- MQTCPConnection.cs : 357 ------------------------------------------------
Please note that the server is up and running and accessible as I can connect to it using the installed IBM client.
The NuGet Managed IBM WebSphere MQ Client for .NET uses the IBM MQ 8.0.0.5 MQ libraries.
I found this APAR IT14222 from IBM which seems to be a match for the exact error message you received.
This is supposed to be fixed in the next fixpack 8.0.0.6 which should be out by the end of March 2017. If you have a IBM support contract you can also open a PMR and request that they provide you a copy of the impacted dll that has a fix for this APAR included against 8.0.0.5.