|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
How to read/write MQ headers using Monitoring events |
« View previous topic :: View next topic » |
Author |
Message
|
Yoel |
Posted: Tue Aug 25, 2015 9:09 am Post subject: |
|
|
Novice
Joined: 03 Apr 2012 Posts: 17
|
mqjeff wrote: |
You might need to split the BLOB at the start of your message data, and then parse the first chunk using the MQ domain and the second chunk using your proper message domain.
Obviously, all of this after you decode the message data.
You might also be able to just use an RCD node. |
This is exactly my challenge.
If I just knew how to split the message from the headers,
and if I knew of an general MQ domain, life would be much easier.. |
|
Back to top |
|
 |
Yoel |
Posted: Tue Aug 25, 2015 9:21 am Post subject: |
|
|
Novice
Joined: 03 Apr 2012 Posts: 17
|
timber wrote: |
I don't think you can use CREATE...PARSE to parse a BLOB into its various header/body trees. But an MQInput node does that job really nicely. Any reason not to use an intermediate queue, and let IIB do the heavy lifting for you? |
How do you suggest putting this message into a queue without providing an MQMD?
Let me note again, I am not locked to a solution in ESQL.
If life would be easier using Java / JMS or anything else, it would be just as good.
I noticed this requirement is implemented in the record and replay in the broker to do exactly this: store the message and bode in a database.
It is also implemented in rfhutil in the read from file feature. |
|
Back to top |
|
 |
timber |
Posted: Tue Aug 25, 2015 10:22 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
I'm quoting the original problem statement, just for reference:
Quote: |
I'm trying to write from an IIB v9 monitoring event - an entire MQ message (MQ headers and body) , and read the message later in a different flow / java app to store the payload and headers in a database in a readable way.
Should I select 'All' in 'include bitstream data in payload' in the event?
If so, I must select a binary format (base64Binary or hexBinary) since the MQ headers are binary. How would I parse the bitstream in the reading flow / java app, so I can write the info into a database? |
I would do it like this:
- In the emitting message flow, include all of the bitstream in the monitoring event, and encode it as base64 for compactness.
- In a receiving message message flow ( one that subscribes to the topic where the monitoring events are published ), decode the base64 string into a BLOB ( there is an ESQL function for that ), put the BLOB into OutputRoot.BLOB.BLOB, and put the result onto an intermediate queue using an MQOutput node.
- In a third and final message flow, parse the input with an MQInput node and do whatever is required to turn the headers and the body into XML. |
|
Back to top |
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|