IBM MQ Blast sample program to send bulk messages

The MQ sample “amqsblst” (also called “Blast”) will be used to test putting/getting a
large quantity of messages (10,000) into the queue.


In Unix the following 3 commands were used. Note that “date” in Unix displays both
the date and time.
Blast putting 10000 messages of size 2K queue Q1 on queue manager


date; amqsblst TQM1 QR -W -c 10000 -s 2048; date


The important line from the execution is the one that shows the “elapsed time”.

Help from the amqsblst program is as shown in the below

C:\Windows\system32>amqsblst

welcome to blast
Usage: amqsblst queue_manager queue -R -W -s message_size -c message_count -C correlid -v
where
queue_manager : queue manager name
queue : queue to read from or write to
-R : read messages from queue
-W : write messages to queue
-s message_size : size of messages to write, or random (range 1-262144)
-c message_count : number of messages to write range 1 upwards
-C correlid : correllation ID
-u uow_size : unit of work size
-v : verbose messages

C:\Windows\system32>

Example here we will be sending 10000 message with each message of 2 K using blast program

amqsblst TQM1 QR -W -c 10000 -s 2048

C:\Windows\system32>amqsblst TQM1 QR -W -c 10000 -s 2048

welcome to blast
Blast> successfully opened queue
Blast> 100 messages sent
Blast> MQPUT failed with reason code 2053
Blast> failed to put msg (101) to queue
Blast> elapsed time = 2530 mS
Blast> failed to put msgs to queue
Blast> ended
Blast> 100 messages have been put
Blast> 0 messages have been got

C:\Windows\system32>

make sure the queue has enough capacity to keep the messages Above error is queue full.

As MQ administrator alter the maximum amount of messages that can be held. The
default is 5,000 which is a bit short for this type of test.

message
message
message
no more messages
Sample AMQSGET0 end

C:\Windows\system32>amqsblst TQM1 QR -W -c 10000 -s 2048

welcome to blast
Blast> successfully opened queue
Blast> 100 messages sent
Blast> 200 messages sent
Blast> 300 messages sent
Blast> 400 messages sent
Blast> 500 messages sent
Blast> 600 messages sent
Blast> 700 messages sent
Blast> 800 messages sent
Blast> 900 messages sent
Blast> 1000 messages sent
Blast> 1100 messages sent
Blast> 1200 messages sent
Blast> 1300 messages sent
Blast> 1400 messages sent
Blast> 1500 messages sent

……..

Blast> 9500 messages sent
Blast> 9600 messages sent
Blast> 9700 messages sent
Blast> 9800 messages sent
Blast> 9900 messages sent
Blast> 10000 messages sent
Blast> elapsed time = 276060 mS
Blast> ended
Blast> 10000 messages have been put
Blast> 0 messages have been got

C:\Windows\system32>

Note the elapsed time in case if you want to see the performance of MQ . some case you many need to calculate the performance before enabling AMS policy and after .

if the message go to DEAD queue then browse the message and read the reason code in the below way

To interpret the reason code for sending the message into this queue, get the values for the
bytes 9 thru 12:
00000000: 444C 4820 0100 0000 0F08 0000 512E 414D ‘DLH ……..Q.AM’

The desired bytes are:
0F08 0000
.
Because the host used in this example is based on the Intel architecture, it is necessary to
reverse the byte order:
0F08 0000 => 0000 080F
.
The value is in hex and you can use the MQ utility “mqrc” to get an idea of the reason code:
mqrc 0x0000080F
.
$ mqrc 0x0000080F
2063 0x0000080f MQRC_SECURITY_ERROR

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *