ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Store input message in local environment

Post new topic  Reply to topic
 Store input message in local environment « View previous topic :: View next topic » 
Author Message
Ashimashi
PostPosted: Tue Oct 11, 2011 10:49 pm    Post subject: Store input message in local environment Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Oct 11, 2011 11:28 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Ashimashi
PostPosted: Wed Oct 12, 2011 12:24 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Wed Oct 12, 2011 1:19 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Ashimashi
PostPosted: Wed Oct 12, 2011 1:28 am    Post subject: Reply with quote

Novice

Joined: 06 Oct 2011
Posts: 20

Excellent. Thank you for the tip. Seems like it's working properly

Thanks,
A
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Store input message in local environment
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.