Stop a queue manager
We can use the endmqm command to stop a queue manager. This command provides three ways to stop a queue manager: a controlled, or quiesced, shutdown, an immediate shutdown, and a preemptive shutdown. Alternatively, on Windows and Linux , we can stop a queue manager by using the IBM MQ Explorer.
There are three ways to stop a single instance queue manager with the endmqm command:
- Controlled (quiesced) shutdown
- By default, the endmqm command performs a quiesced shutdown of the specified queue manager. A quiesced shutdown waits until all connected applications have disconnected, so might take a while to complete.
- Immediate shutdown
- For an immediate shutdown, any current MQI calls are allowed to complete, but any new calls fail. This type of shutdown does not wait for applications to disconnect from the queue manager.
- Preemptive shutdown
- The queue manager stops immediately. 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 endmqm command stops all instances of a multi-instance queue manager in the same way as it stops a single instance queue manager. We can issue the endmqm on either the active instance, or one of the standby instances of a multi-instance queue manager. However, you must issue endmqm on the active instance to end the queue manager.
For a detailed description of the endmqm command and its options, see endmqm.
Tip: Problems with shutting down a queue manager are often caused by applications. For example, when applications:If a problem occurs when you try to stop the queue manager, we can break out of the endmqm command by using Ctrl-C. We can then issue another endmqm command, but this time with a parameter that specifies the type of shutdown that you require.
- Do not check MQI return codes properly
- Do not request notification of a quiesce
- Terminate without disconnecting from the queue manager (by issuing an MQDISC call)
As an alternative to using the endmqm command, on Windows and Linux, we can stop a queue manager by using the IBM MQ Explorer to carry out either a controlled or an immediate shutdown.
Procedure
- To stop the queue manager by using the endmqm command, enter the command followed by the parameter, if required, and the name of the queue manager to stop. Note: You must use the endmqm command from the installation associated with the queue manager that you are working with. To find out which installation a queue manager is associated with, use the following command: dspmq -o installation.
- To carry out a controlled (quiesced) shutdown, enter the endmqm command as shown in the following example, which stops a queue manager called QMB:
endmqm QMBAlternatively, entering the endmqm command with the -c parameter , as shown in the following example, is equivalent to an endmqm QMB command.endmqm -c QMBIn both cases, control is returned to you immediately and you are not notified when the queue manager has stopped. If you want the command to wait until all applications have stopped and the queue manager has ended before returning control to you, use the -w parameter instead as shown in the following example.endmqm -w QMB- To carry out an immediate shutdown, enter the endmqm command with the -i parameter as shown in the following example:
endmqm -i QMB- To carry out a preemptive shutdown, enter the endmqm command with the -p parameter as shown in the following example:
endmqm -p QMBAttention: A preemptive shutdown can have unpredictable consequences for connected applications. Do not use this option unless all other attempts to stop the queue manager by using a normal endmqm command have failed. If the preemptive shutdown does not work, try stopping the queue manager manually instead.- To request automatic client reconnection, enter the endmqm command with the -r parameter. This parameter has the effect of reestablishing the connectivity of clients to other queue managers in their queue manager group. Note: Ending a queue manager by using the default endmqm command does not trigger automatic client reconnection.
- To transfer to a standby instance of a multi-instance queue manager after shutting down the active instance, enter the endmqm command with the -s parameter on the active instance of the multi-instance queue manager.
- To end the standby instance of a multi-instance queue manager and leave the active instance running, enter the endmqm command with the -x parameter on the standby instance of the multi-instance queue manager.
- On Windows and Linux, to stop the queue manager by using IBM MQ Explorer, complete the following steps:
- Open the IBM MQ Explorer.
- Select the queue manager from the Navigator View.
- Click Stop. The End Queue Manager panel is displayed.
- Select Controlled, or Immediate.
- Click OK. The queue manager stops.