Author |
Message
|
nick12 |
Posted: Thu Jul 18, 2024 9:23 am Post subject: Get the Topic Name of an MQ message being read from a queue |
|
|
Novice
Joined: 14 Jan 2020 Posts: 18
|
Suppose I have a Topic in my MQ queue manager, a subscription from that topic to an MQ queue, and an ESB/IIB/ACE flow processing messages from that queue using an MQInput node.
Is there a way to, inside the flow, get the name of the topic that the message being processed originated from? This is purely for logging purposes. |
|
Back to top |
|
|
gbaddeley |
Posted: Tue Jul 23, 2024 5:39 pm Post subject: Re: Get the Topic Name of an MQ message being read from a qu |
|
|
Jedi Knight
Joined: 25 Mar 2003 Posts: 2536 Location: Melbourne, Australia
|
|
Back to top |
|
|
nick12 |
Posted: Wed Jul 24, 2024 7:15 am Post subject: Re: Get the Topic Name of an MQ message being read from a qu |
|
|
Novice
Joined: 14 Jan 2020 Posts: 18
|
Thanks for the response!
I did find info about using MQINQMP , however I do not know how to do that from within the broker (Ideally in an ESQL compute node, without using java).
And since I'm reading from a queue (Not the topic directly) with an MQInput in the broker, I'm not sure that the `MQRFH2` folder of the publish message is available (If it is, I haven't been able to figure out how to access it). |
|
Back to top |
|
|
timber |
Posted: Thu Jul 25, 2024 5:56 am Post subject: |
|
|
Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
|
Back to top |
|
|
nick12 |
Posted: Thu Jul 25, 2024 6:22 am Post subject: |
|
|
Novice
Joined: 14 Jan 2020 Posts: 18
|
I checked and EXISTS(InputRoot.MQRFH2[]) is giving me false.
I also checked for MQRFH2C and it also gives false
I tried both with and without checking the "Use MQRFH2C compact parser for MQRFH2 header" checkbox on the input node.
Note that, as I stated previously, I'm reading from a *queue*, not from the topic directly. Could that be why the RFH2 header does not seem to be available?
I do have `InputRoot.MQMD` available, but all it seems to have is the queue name. |
|
Back to top |
|
|
nick12 |
Posted: Thu Jul 25, 2024 6:36 am Post subject: |
|
|
Novice
Joined: 14 Jan 2020 Posts: 18
|
I figured out that I can configure "RFH2" instead of "Message properties" in the MQ susbscription with MQ Explorer, and doing so makes an RFH2 folder show up in the message the broker gets.
Doing so makes `InputRoot.MQRFH2.psc.Topic` contain the string I was looking for.
Thank you both for your help. |
|
Back to top |
|
|
|