+

Search Tips | Advanced Search

Connecting to a queue manager in IBM MQ classes for Java

Connect to a queue manager by creating a new instance of the MQQueueManager class. Disconnect from a queue manager by calling the disconnect() method.

You are now ready to connect to a queue manager by creating a new instance of the MQQueueManager class:
MQQueueManager queueManager = new MQQueueManager("qMgrName");
To disconnect from a queue manager, call the disconnect() method on the queue manager:
queueManager.disconnect();

If you call the disconnect method, all open queues and processes that we have accessed through that queue manager are closed. However, it is good programming practice to close these resources explicitly when you finish using them. To do this, use the close() method on the relevant objects.

The commit() and backout() methods on a queue manager are equivalent to the MQCMIT and MQBACK calls that are used with the procedural interface.