FreeKB - GET (remove) messages in a queue in IBM MQ using the amqsget command
GET (remove) messages in a queue in IBM MQ using the amqsget command

Home > Search


These examples are based on a Linux system. Switch to the mqm user.

su - mqm

 

The amqsget command can be used to GET the messages in a queue. In this example, there is one message in QUEUE01, and the message contains the text Hello World. Be aware that this will remove the message from the local queue, as this is a GET operation. If you are unsure of the <mq install> directory, use the dspmqinst command.

<mq install>/samp/bin/amqsget QUEUE01 MANAGER01
Sample AMQSGET0 start
message <Hello World>
Sample AMQSGET0 end

 

If there are no messages in the queue, the following will be displayed.

<mq install>/samp/bin/amqsget QUEUE01 MANAGER01
Sample AMQSGET0 start
no more messages
Sample AMQSGET0 end

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter 33d10 in the box below so that we can be sure you are a human.




Comments