Chapter 6 Reading Messages
Reading Messages - MQXMIT
This section will describe how to read a message in a queue and how it will be displayed when it contains a MQXMIT 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 TEST01.Q
Unix
./mqbt.sh Read -a /Capitalware/MQBT/CommProfileDB.properties -p MQA1 -q TEST01.Q
If the queue had 1 message, it may look like this:
------------------------------ Message # 1 ------------------------------
Transmission Queue Header:
Remote Q Name: ABC.XYZ.LQ
Remote Q Manager Name: FRED
Message Descriptor:
Structure ID: MD Version: 1
*General:
Message Type: MQMT_DATAGRAM
Message Priority: 0 Message Persistence: MQPER_NOT_PERSISTENT
Put Date: 2004-08-30 Expiry Interval: -1
Put Time: 16:24:20.63 Backout Count: 0
Reply-To Queue:
Reply-To Queue Manager: MQA1
*Report:
Report: 0
Feedback Code: MQFB_NONE
*Context:
User ID: 'lacrorog '
Put-Application Type: MQAT_WINDOWS_NT
Put-Application Name: ':\j2sdk1.4.2_02\bin\java.exe'
Application Identity Data: ' '
Application Origin Data: ' '
Accounting Token: X'1601051500000075B9755437DA950F828BA62826B2000000000000000000000B'
*Identifiers:
Message ID X'414D51204D5141312020202020202020DA4C334120000901'
Correlation ID X'000000000000000000000000000000000000000000000000'
*Attributes:
Format: MQSTR
CCSID: 819 Encoding: 273
Raw Data:
This is a test message.
Line #2
and the last line - #3 |
|