[UNIX, Linux, Windows, IBM i]

Stopping a queue manager

You can use the endmqm command to stop a queue manager. This command provides four ways to stop a queue manager: a controlled, or quiesced, shutdown, an immediate shutdown, a preemptive shutdown, and a wait shutdown. Alternatively, on Windows and Linux®, you can stop a queue manager by using the IBM® MQ Explorer.

About this task

There are four 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.
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.

The endmqm command stops all instances of a multi-instance queue manager in the same way as it stops a single instance queue manager. You 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.

[MQ 9.2.0 Jul 2020]From IBM MQ 9.1.4, you have the option to end the queue manager within a target time of a number of seconds that you specify, see Ending a queue manager within a target time for more details.

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:
  • 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)
If a problem occurs when you try to stop the queue manager, you can break out of the endmqm command by using Ctrl-C. You can then issue another endmqm command, but this time with a parameter that specifies the type of shutdown that you require.

[Windows][Linux]As an alternative to using the endmqm command, on Windows and Linux, you 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 appropriate parameter, if required, and the name of the queue manager that you want 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 dspmq 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 QMB
      
      Alternatively, entering the endmqm command with the -c parameter , as shown in the following example, is equivalent to an endmqm QMB command.
      endmqm -c QMB
      In 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 QMB
      
      Attention: 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. [AIX, Linux, Windows]If the preemptive shutdown does not work, try Stopping a 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.
  • [Windows][Linux] On Windows and Linux, to stop the queue manager by using IBM MQ Explorer, complete the following steps:
    1. Open the IBM MQ Explorer.
    2. Select the queue manager from the Navigator View.
    3. Click Stop.
      The End Queue Manager panel is displayed.
    4. Select Controlled, or Immediate.
    5. Click OK.
      The queue manager stops.