We have moved to www.dataGenX.net, Keep Learning with us.

Wednesday, April 10, 2013

Start/Stop/Delete a Queue Manager

Starting a Queue Manager

Before we can use a Queue Manager, we need to start it, using the STRMQM command. The command to start a Queue Manager called QMA is:

$ strmqm QMA
You should see output similar to the following on your screen:
WebSphere MQ queue manager 'QMA' starting.
2108 log records accessed on queue manager 'QMA' during the log replay phase.
Log replay for queue manager 'QMA' complete.
Transaction manager state recovered for queue manager 'QMA'.
WebSphere MQ queue manager 'QMA' started.

Checking that the Queue Manager is running

To check that a Queue Manager is active, use the DSPMQ MQ command:

$ dspmq
If the Queue Manager is active it should have a status of "Running" as follows:

Stopping a Queue Manager

To stop (end) a Queue Manager, use the ENDMQM command. This command has four possible parameters:
  • -c: Controlled/quiesced shutdown. This is the default. The queue manager stops, but only after all applications have disconnected. Any calls currently being processed are completed.
  • -w: Wait shutdown. This type of shutdown is equivalent to a controlled shutdown except that control is returned to you only after the Queue Manager has stopped. You receive the message Waiting for Queue Manager qmName to end while shutdown progresses.
  • -i: Immediate shutdown. The Queue Manager stops after it has completed all the calls currently being processed. Any MQI requests issued after the command has been issued fail. Any incomplete units of work are rolled back when the Queue Manager is next started. Control is returned after the Queue Manager has ended.
  • -p: Preemptive shutdown—use this type of shutdown only in exceptional circumstances. For example, when a Queue Manager does not stop as a result of a normal endmqm command. The Queue Manager might stop without waiting for applications to disconnect or for MQI calls to complete.
If we want to suppress error messages, then we just have to add the –z parameter to the command.
An example of the command to stop Queue Manager QMA is shown next:

$ endmqm –i QMA

Deleting a Queue Manager

The command to delete/drop a Queue Manager is DLTMQM, but before we can issue that command we need to stop all the Listeners for the Queue Manager and then stop (end) the Queue Manager.
The following command will stop all the Listeners associated with Queue Manager pointed to by the –m flag (QMA in this example). The –w flag means the command will wait until all the Listeners are stopped before returning control:

$ endmqlsr -w -m QMA

The command to stop (end) the Queue Manager is:
$ endmqm QMA

And fnally the command to delete the Queue Manager is:
$ dltmqm QMA