.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -


"itemprop =" text ">

I am writing applications that use WebSphere MQ to send messages. My unittests (for flow), I want to verify that I have put the correct message on the response queue. I am trying to figure out how to do this. My main obstacle is that I think it might be scary to clear the queue before running in my queue because the same queue can be used by other applications, I thought a decent solution would be a new line The manager will remove the queue for my solidarity and after using it. So my question is: Is it possible to use C # by using queue manager and queue?

After the

For future reference and future people, who want to make queues. I thought how to make and remove IBM MQ QE (not quenhers) with PCM messaging. It is not very simple, but it can be done.

We have implemented it in a library and it is being used to create and delete commands before and after integration tests. The most important part of the code in this library is shown in the code sample below. Simply add a reference to amqmdnet.dll and below the code it will be made a queue and

  string queueManagerName = "QM_LOCAL". String queue name = "deleted mike"; Hashtable option = new hashtable (); // Use a 'TRANSPORT_MQSERIES_CLIENT', 'TRANSPORT_MQSERIES_XACLIENT' or 'TRANSPORT_MQSERIES_MANAGED' option for a remote server that has a connection to this local server. (IBM.WMQ.MQC.TRANSPORT_PROPERTY, "TRANSPORT_MQSERIES_BINDINGS"); // 'TRANSPORT_MQSERIES_CLIENT', 'TRANSPORT_MQSERIES_XACLIENT' or 'TRANSPORT_MQSERIES_MANAGED' below for the // string hostName = "RemoteServerName"; // string channel name = "SYSTEM.ADMIN.SVRCONN"; // int port number = 1414; // options.Add (IBM.WMQ.MQC.HOST_NAME_PROPERTY, hostName); // options.Add (IBM.WMQ.MQC.CHANNEL_PROPERTY, channel name); // options.Add (IBM.WMQ.MQC.PORT_PROPERTY, port number); // options.Add (IBM.WMQ.MQC.CONNECT_OPTIONS_PROPERTY, IBM.WMQ.MQC.MQC.MQCNO_STANDARD_BINDING); IBM.WMQ.MQQueueManager queueManager = null; IBM.WMQ.PCF.PCFMessageAgent Agent = Null; Try {// (remote) a connection to queuemanager and a PCF messaging agent. QueueManager = New IBM. MM. MQUnger (Quenemanjaram, option); Agent = New IBM. Mmp.pcf.pcfmsseagent (quo manager); // Create queue IBM.WMQ.PCF.PCFMessage createRequest = new IBM.WMQ.PCF.PCFMessage (IBM.WMQ.PCF.CMQCFC.MQCMD_CREATE_Q); CreateRequest.AddParameter (IBM.WMQ.MQC.MQCA_Q_NAME, queueName); CreateRequest.AddParameter (IBM.WMQ.MQC.MQIA_Q_TYPE, IBM.WMQ.MQC.MQQT_LOCAL); CreateRequest.AddParameter (IBM.WMQ.MQC.MQIA_DEF_PERSISTENCE, IBM.WMQ.MQC.MQPER_PERSISTENT); "Discounted. Admepator (IBM MMC MQ MQCA_QDSC," + Environmental User Name + "by" + Date Time ". UTNCNO.Tostront (" O "). IBM.WMQ.PCF.PCFMessage [] createResponses = agent.Send (createRequest); // Deleted queue IBM.WMQ.PCF.PCFMessage deleteRequest = new IBM.WMQ.PCF.PCFMessage (IBM.WMQ.PCF.CMQCFC.MQCMD_DELETE_Q); DeleteRequest.AddParameter (IBM.WMQ.MQC.MQCA_Q_NAME, queueName); IBM.WMQ.PCF.PCFMessage [] RemoveTheresons = Agent. Send (delete); } Finally {// disconnect agent and queuemanager. If (agent! = Null) agent Disconnect (); If (query manager! = Null & amp; queueManager.IsConnected) queueManager.Disconnect (); }    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -