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 » copyEntireMessage using Java Compute Node

Post new topic  Reply to topic
 copyEntireMessage using Java Compute Node « View previous topic :: View next topic » 
Author Message
Maverik
PostPosted: Fri Jun 09, 2006 5:43 am    Post subject: copyEntireMessage using Java Compute Node Reply with quote

Apprentice

Joined: 14 Jun 2005
Posts: 27

I am trying to do a copyEntireMessage using the Java compute node... it is throwing a parser could not be created error...can someone tell me how to fix this code.

Code:
public void copyEntireMessage(MbMessage inMessage, MbMessage outMessage, String parser)
         throws MbException {
      
      MbElement outRoot = outMessage.getRootElement();

      // iterate though the headers starting with the first child of the root
      // element
      MbElement header = inMessage.getRootElement().getFirstChild();
      while (header != null && header.getNextSibling() != null)
      {
         // copy the header and add it to the out message
         outRoot.addAsLastChild(header.copy());
         // move along to next header
         header = header.getNextSibling();
      }
      
      header = outRoot.createElementAsLastChild(parser);
      header = outRoot.createElementAsLastChild(MbElement.TYPE_NAME);
      
      header = inMessage.getRootElement().getLastChild();
      
      outRoot.addAsLastChild(header.copy());
   
   }


Except for the last four lines, the rest is from the copyMessageHeaders and works ok...the line with the parser was also ok, but if i exit after that line, i find that the last child is empty...i want to copy the input message to the output.

Please help.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jun 09, 2006 8:41 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

You seem to go about it in a roundabout way.

How about
Code:
outMessage = inMessage;


Now what you did is nice and details the copying of the headers.
By the way you can use the same to copy the body.

Adhere to the KISS principle. Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Sat Jun 10, 2006 5:37 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ac30360_.htm

versus

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ac30350_.htm


_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Jun 10, 2006 2:02 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Thanks Jeff Learning new things every day.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Maverik
PostPosted: Sat Jun 10, 2006 7:17 pm    Post subject: Reply with quote

Apprentice

Joined: 14 Jun 2005
Posts: 27



Sorry, realised it too late...i was not able to debug the flow, finally when something came out of the compute it had two properties, two MQMD's...that's when it sparked...

Thanks everyone.
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 » copyEntireMessage using Java Compute Node
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.