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

62 views Asked by At

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.

3

There are 3 answers

0
chughts On BEST ANSWER

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
0
Roger On

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.

0
gouda On

A possibility is the q.exe formerly known as Support Pac MA01 that is now licensed by MQGem.