MQ Batch Toolkit

Chapter 4 Clearing a Queue by ID

Clearing a Queue by ID.

This section will describe how to clear messages from a queue that match either a Message ID or Correlation ID or both.

Purpose

Use the ClearQByID command to remove the messages of a particular queue of a queue manager that contain particular a Message ID or Correlation ID or both.

Syntax

{mqbt or mqbt.sh} ClearQByID -a Path_and_FileName_for_CommProfileDB -p Profile_Name -q Queue_Name {[-g Message_ID] [-m Correlation_ID]} [-s Start_Position] [-c Message_Count]

Function Name:
ClearQByID

Required Parameters:
-a The full path and filename for a CommProfileDB.properties file.
-p The name of a profile contained in the CommProfileDB.properties file.
-q The name of the queue (Note: Queue names are case sensitive.)

Requires at least 1 of the following parameters:
-g The message id of the message(s) that you wish to delete.
-z The correlation id of the message(s) that you wish to delete.

Optional Parameters:
-s Start position when getting messages from the queue. The default is 1.
-c Number of messages to be read from the queue. The default is all messages.
-X Delete messages that do NOT match either message id or correlation id.

Example 1

  • Clear the messages with a particular Message ID in a queue of a queue manager.

    Windows
    mqbt ClearQByID -a c:\CommProfileDB.properties -p MQA1 -q TEST01.Q -g 414D51204D51413120202020202020209248C34020000904
    Unix
    ./mqbt.sh ClearQByID -a /Capitalware/MQBT/CommProfileDB.properties -p MQA1 -q TEST01.Q -g 414D51204D51413120202020202020209248C34020000904

    Example 2

  • Clear the messages with a particular Correlation ID in a queue of a queue manager.

    Windows
    mqbt ClearQByID -a c:\CommProfileDB.properties -p MQA1 -q TEST01.Q -z 414243444142434400000000000000000000000000000000
    Unix
    ./mqbt.sh ClearQByID -a /Capitalware/MQBT/CommProfileDB.properties -p MQA1 -q TEST01.Q -z 414243444142434400000000000000000000000000000000

    Example 3

  • Clear the messages that both a particular Message ID and a particular Correlation ID in a queue of a queue manager.

    Windows
    mqbt ClearQByID -a c:\CommProfileDB.properties -p MQA1 -q TEST01.Q -g 414D51204D51413120202020202020209248C34020000904 -z 414243444142434400000000000000000000000000000000
    Unix
    ./mqbt.sh ClearQByID -a /Capitalware/MQBT/CommProfileDB.properties -p MQA1 -q TEST01.Q -g 414D51204D51413120202020202020209248C34020000904 -z 414243444142434400000000000000000000000000000000

     




  • Copyright © 2004-2008 Capitalware Inc.  All Rights Reserved.