public static void Start() { //// Setup some test data string queueManagerName = "BETS.UAT.QM"; string host = "10.3.103.83"; int port = 1453; string channel = "TCP.CLIENTS"; //// Setup some test data //string queueManagerName = "QM_TEST2"; //string host = "10.3.103.83"; //int port = 1421; //string channel = "QM_TEST.SVRCONN"; WMQTester tester = new WMQTester(); tester.Connect(queueManagerName, host, port, channel); } public MQQueueManager Connect(string queueManagerName, string host, int port, string channel) { MQQueueManager queueManager; // Setup connection information Hashtable queueProperties = new Hashtable(); queueProperties[MQC.HOST_NAME_PROPERTY] = host; queueProperties[MQC.PORT_PROPERTY] = port; queueProperties[MQC.CHANNEL_PROPERTY] = channel; //queueProperties[MQC.USER_ID_PROPERTY] = "mqm"; //queueProperties[MQC.PASSWORD_PROPERTY] = ""; try { // Attempt the connection queueManager = new MQQueueManager(queueManagerName, queueProperties); Console.WriteLine("Connected Successfully"); } catch (MQException mexc) { // TODO: Setup other exception handling throw new Exception(mexc.Message + " ReasonCode: " + mexc.ReasonCode + "--- see list of Reason Codes at http://russsutton.com/developer/?p=45 " + mexc.StackTrace, mexc); } // For now, return the queueManager to use in reading/writing messages next return queueManager; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)