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 » Setting MQMD To GlobalEnvironment Using JavaCompute Node

Post new topic  Reply to topic
 Setting MQMD To GlobalEnvironment Using JavaCompute Node « View previous topic :: View next topic » 
Author Message
SandiSan
PostPosted: Thu Sep 14, 2006 5:45 am    Post subject: Setting MQMD To GlobalEnvironment Using JavaCompute Node Reply with quote

Acolyte

Joined: 01 Apr 2006
Posts: 57
Location: Pune/India

Hi,

We are trying to set MQMD Header that is coming as a part of incomming message in JavaCompute Node.Below is the code

//getting handle to out terminal
MbOutputTerminal out = getOutputTerminal("out");

//getting handle to alternate terminal
MbOutputTerminal alt = getOutputTerminal("alternate");

// getting handle to incomming message
MbMessage inMessage = contact admin.getMessage();
// getiing handle to rootelement of message
MbElement mqmdMsg = inMessage.getRootElement();

MbElement mqchild = mqmdMsg.getFirstChild();
MbElement mqhd = mqchild.getNextSibling();
// getting handle to Global Env Tree
MbMessage gEnv = contact admin.getGlobalEnvironment();

// creating new child in Global Env Tree and setting the MQMD stored in
// mqhd variable of type MbElement
gEnv.getRootElement().createElementAsFirstChild(MbElement.TYPE_NAME_VALUE,"InputMQMDHeader",mqhd);

// create new message
MbMessage outMessage = new MbMessage(inMessage);
MbMessageAssembly outAssembly = new MbMessageAssembly(contact admin,outMessage);

The problem we are facing is when the control comes out of JCN we are not able to see the MQMD in Environment var.

Please let us know where we are going wrong.Its the requirement to do in JCN only not to go for Compute Node.

Regards
SandiSan
Back to top
View user's profile Send private message Yahoo Messenger
jefflowrey
PostPosted: Thu Sep 14, 2006 6:08 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You're trying to insert an entire tree as an Element, I think.

Try
Code:
MBElement geMQHD = gEnv.getRootElement().createElementAsFirstChild(MbElement.TYPE_NAME,"InputMQMDHeader",null);
geMQHD.addAsLastChild(mqhd.copy());

_________________
I am *not* the model of the modern major general.
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 » Setting MQMD To GlobalEnvironment Using JavaCompute 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.