How to get a IBM MQ message by Message ID using bash ? is there a tool available?

Looking to get an IBM MQ message by Message ID using bash

Is there a tool readily available ? can any of the bash samples that come MQ installation serve the purpose? Please let me know.

You could issue a CURL command to invoke the REST API in your bash script.

eg.

curl -X DELETE --header 'Accept: application/json' 'https://HOST:PORT/ibmmq/rest/v3/messaging/qmgr/QM1/queue/DEV.QUEUE.1/message?messageId=MSGID'

Substitute
MSGID for your message ID
HOST for your queue manager address
PORT for your queue manager REST port
QM1 for the queue manager
DEV.QUEUE.1 for the queue

There is no MQ API for Bash. You can use C, C++, C#, COBOL, PL/I, Java, Rexx, RPG, Perl and Python. See https://en.wikipedia.org/wiki/IBM_MQ#APIs

If you want to use a scripting language with MQ then I’d suggest using either Python or REXX.

Leave a Comment