protected void InitializeQueueManager(WmqResourceManager resourceManager) { char[] separator = { '/' }; string[] channelParams = ChannelInfo.Split(separator); if (channelParams.Length < 3) { throw new ApplicationException("ChannelInfo config parameter is not in the proper format. It must include two /'s and must be in this format: channel/transport type/connection. Example: CHANNEL1/TCP/mqwind.ttx.com(1444)"); } string channelName = channelParams[0]; string transportType = channelParams[1]; string connectionName = channelParams[2]; try { resourceManager.QueueManager = new MQQueueManager(QueueManager, channelName, connectionName); } catch (Exception ex) { logger.Error("Exception in WmqTransportBase.InitializeQueueManager trying to connect to: " + QueueManager + " using channel " + channelName + " and connection " + connectionName + Environment.NewLine + ex.Message); throw; } return; }
protected void InitializeInputQueue(WmqResourceManager resourceManager) { MQQueue queue = resourceManager.QueueManager.AccessQueue(InputQueue, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_BROWSE); resourceManager.Queue = queue; return; }
/// <summary> /// Stops all worker threads and disposes the WMQ queue. /// </summary> public void Dispose() { lock (this.workerThreads) for (int i = 0; i < workerThreads.Count; i++) { this.workerThreads[i].Stop(); } if (receiveResourceManager != null) { receiveResourceManager.CloseWMQConnections(); receiveResourceManager = null; } if (sendResourceManager != null) { sendResourceManager.CloseWMQConnections(); sendResourceManager = null; } }