Author |
Message
|
Ashimashi |
Posted: Tue Oct 11, 2011 10:49 pm Post subject: Store input message in local environment |
|
|
Novice
Joined: 06 Oct 2011 Posts: 20
|
Hi there,
I'm not sure if this topic has been around in the forum. Been searching without any luck. I'm parsing a fix length message to MRM and I would like to store this message in my local environment for later use. This is what I'm trying to do in my code:
Code: |
MbMessage inMessage = contact admin.getMessage();
// Get MRM element
MbElement inputBody = (MbElement) inMessage.getRootElement().getLastChild();
MbMessage env = contact admin.getLocalEnvironment();
MbMessage newEnv = new MbMessage(env);
// Store data in local environment
newEnv.getRootElement().createElementAsFirstChild(
MbElement.TYPE_NAME_VALUE,
"Status", inMessage.toString());
|
The inMessage.toString() at the end is obviously incorrect. I just want to show what I'm trying to achieve. Is it possible to get the string representative of the inMessage containing the data?
Thank you for helping out,
/A |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Oct 11, 2011 11:28 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You'd have to use ASBITSTREAM or in this case its java equivalent ... Remember also that you might want to set a parser on that part of the env tree.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Ashimashi |
Posted: Wed Oct 12, 2011 12:24 am Post subject: |
|
|
Novice
Joined: 06 Oct 2011 Posts: 20
|
Thank you saper for the quick reply. That was exactly what I was thinking of doing... I'm just wondering about the parsing part on the env tree side. I haven't found a way of doing it. Do you have a tip?
Thanks,
A |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Oct 12, 2011 1:19 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Ashimashi wrote: |
Thank you saper for the quick reply. That was exactly what I was thinking of doing... I'm just wondering about the parsing part on the env tree side. I haven't found a way of doing it. Do you have a tip?
Thanks,
A |
If you want it as text and not parsed you might want to add a BLOB parser to that part of the env tree. _________________ MQ & Broker admin |
|
Back to top |
|
 |
Ashimashi |
Posted: Wed Oct 12, 2011 1:28 am Post subject: |
|
|
Novice
Joined: 06 Oct 2011 Posts: 20
|
Excellent. Thank you for the tip. Seems like it's working properly
Thanks,
A |
|
Back to top |
|
 |
|