MQ Batch Toolkit

Chapter 6 Reading Messages

Reading Messages - MQRFH

This section will describe how to read a message in a queue and how it will be displayed when it contains a MQRFH header.

Purpose

Use the Read command to read messages in the queue.

Syntax

{mqbt or mqbt.sh} Read -a Path_and_FileName_for_CommProfileDB -p Profile_Name -q Queue_Name [-s Start_Position] [-c Message_Count] [-C] [-D] [-M] [-H] [-E]

Function Name:
Read

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.)

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.
-C Convert on Get
-D Remove messages from the queue as they are read (destructive get).
-M Display the MQMD fields before display the message's data.
-H Display the message data in a hex format.
-E Display the message data in a hex format but the character convert to EBCDIC.

Example 1

  • Read all messages from the queue.

    Windows
    mqbt Read -a c:\CommProfileDB.properties -p MQA1 -q SYSTEM.BROKER.CONTROL.QUEUE
    Unix
    ./mqbt.sh Read -a /Capitalware/MQBT/CommProfileDB.properties -p MQA1 -q SYSTEM.BROKER.CONTROL.QUEUE

    If the queue had 1 message, it may look like this (the message text begins after 'Raw Data:'):
    ------------------------------ Message # 1 ------------------------------
    Rules and Formatting Header v1:
      Structure ID: RFH            Version: 1
      Header Length: 134           Format: MQSTR
      CCSID: 819                   Encoding: 273
      Flags: 0
    Raw Data:
    MQPSCommand  RegSub  MQPSTopic topic MQPSQName subscriberqueue MQPSStreamName stream MQPSQMgrName MQA1

     




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