Date Created: Wed 30-Jan-2008

Related Document Categories:


    Today I learned the command

    endmqm (end queue manager)

    Purpose:
    Use the endmqm command to end (stop) a specified local queue manager. This command stops a queue manager in one of three modes:
    Controlled or quiesced shutdown
    Immediate shutdown
    Preemptive shutdown
    The attributes of the queue manager and the objects associated with it are not affected. You can restart the queue manager using the strmqm (Start queue manager) command.

    To delete a queue manager, stop it and then use the dltmqm (Delete queue manager) command.

    Issuing the endmqm command will effect any client application connected through a server-connection channel. The effect varies depending on the parameter used, but it is as though a STOP CHANNEL command was issued in one of the three possible modes. See WebSphere MQ Clients, for information on the effects of STOP CHANNEL modes on server-connection channels. The endmqm optional parameter descriptions state which STOP CHANNEL mode they will be equivalent to.

    Note: The endmqm command does not allow the ability to stop all queue managers at once. You have to stop them one at a time. This is often scripted by MQ admins.

    Examples:

    -bash-3.1$ endmqm venus.queue.manager
    Quiesce request accepted. The queue manager will stop when all outstanding work
    is complete.

    ----------------------------------------------

    To do: A script to end all Message Queue Managers.

    #stopmqm.sh
    queuemanagers=`dspmq | awk '{ print $1 }' | tr -d "(QMNAME)"`
    echo $queuemanagers
    for i in $queuemanagers
    do
    `endmqm $i`
    done

    or use sed as opposed to trim

    queuemanagers=`dspmq | awk '{ print $1 }' | sed 's/QMNAME(//g;s/)//g'`
    echo $queuemanagers
    for i in $queuemanagers
    do
    `endmqm $i`
    done

    ----------------------------------------------

    The script above will put a request on the queue, but have to grep for STATUS(Ended normally) as it might take a while for queue manager to shut down ie as shown below

    after a call to stopmqm.sh

    QMNAME(venus.queue.manager) STATUS(Ended normally)
    QMNAME(my.queue.manager) STATUS(Quiescing)

Middleware Mentor - Steven Charles Robinson

About Me

Steve Robinson has been working in IT for over 15 years and has provided solutions for many large-enterprise corporate companies across the world. Steve specialises in Java and Middleware consulting. Steve comes from both an administration and development background.

Before moving to JEE, Steve was an accomplished developer and consultant for both IBM Lotus Notes and Microsoft .NET Technologies.

Follow Steve as @stevencrobinson on twitter.

Read my books?

IBM WebSphere Application Server 8.0 Administration Guide

IBM WebSphere Application Server 8.0 Administration Guide

WebSphere Application Server 7.0 Administration Guide

WebSphere Application Server 7.0 Administration Guide

WebSphere Categories

Oracle WebLogic Categories

JBoss Categories

Other Categories