|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Trying to debug simple flow with inconsistant results |
« View previous topic :: View next topic » |
Author |
Message
|
GregG |
Posted: Mon Jul 31, 2006 9:35 am Post subject: Trying to debug simple flow with inconsistant results |
|
|
Novice
Joined: 31 Jul 2006 Posts: 18
|
Hi
I installed WMB6.0 on my Windows laptop and dowdloaded the pager sample.
It seems to work fine.
Then I modified the flow to add a few comput nodes. In the first node I defined 2 environment variables HostName and UserId
then in a subsequent node I add the hostname to the output message.
For now I set the host to unknown to see if that gets output with the message.
When I run the flow the host is not in the output, however if I run in debug mode, the output will have the hostname (currently Unknown) in the message.
Has anyone seen flow working differently when in debug mode... this seems very confusion to me.
Any suggestions would be greatly appreciated.
Thanks,
Greg |
|
Back to top |
|
 |
jbanoop |
Posted: Mon Jul 31, 2006 11:02 pm Post subject: |
|
|
Chevalier
Joined: 17 Sep 2005 Posts: 401 Location: SC
|
Could you post the code in both compute nodes u r using ?
Regards,
Anoop |
|
Back to top |
|
 |
GregG |
Posted: Tue Aug 01, 2006 5:10 am Post subject: |
|
|
Novice
Joined: 31 Jul 2006 Posts: 18
|
Attahced codd as requested.
One more question is where does the System.out.println..output go to???
In the first compute node i just define the vaiables:
SET "Environment"."Variables"."Hostname" = 'Host Unknown ';
SET "Environment"."Variables"."UserId" = 'User Id Unknown ';
-------------
After the java node I have this code in another compute node:
CALL CopyEntireMessage();
SET "OutputRoot"."MRM"."Text" = OutputRoot.MRM.Text || "Environment"."Variables"."Hostname";
In the Java node:
/*
* Created on Jul 31, 2006
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package Java2;
import java.net.InetAddress;
import java.net.UnknownHostException;
import com.ibm.broker.javacompute.MbJavaComputeNode;
import com.ibm.broker.plugin.*;
/**
* @author Glassic
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class TextMessenger_JavaCompute2 extends MbJavaComputeNode {
public void evaluate(MbMessageAssembly contact admin) throws MbException {
MbOutputTerminal out = getOutputTerminal("out");
MbOutputTerminal alt = getOutputTerminal("alternate");
MbMessage inMessage = contact admin.getMessage();
// create new message
MbMessage outMessage = new MbMessage(inMessage);
MbMessageAssembly outAssembly = new MbMessageAssembly(contact admin,
outMessage);
try {
// ----------------------------------------------------------
// Add user code below
String hostName = "";
String _noeTraceOutfile = "";
System.out.println("1. Host = " + hostName);
InetAddress localAddress = InetAddress.getLocalHost();
hostName = localAddress.getHostName();
System.out.println("2. Host = " + hostName);
//Get Environment tree root
MbElement envElement = outAssembly.getGlobalEnvironment().getRootElement();
//Get the hostname element
MbElement hostElement = envElement.getFirstElementByPath("/Variables/Hostname");
//Set the value of the Hostname element to the value of the localhost
hostElement.setValue(hostName);
// End of user code
// ----------------------------------------------------------
// The following should only be changed
// if not propagating message to the 'out' terminal
out.propagate(outAssembly);
System.out.println("done");
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
// clear the outMessage
outMessage.clearMessage();
}
}
}
-----
In the subsequent
in debug mode I will get the correct host name appended to the text of the pager message, without dbug mode, I get just the message....seems really weird to me..
Also do you |
|
Back to top |
|
 |
msukup |
Posted: Tue Aug 01, 2006 11:09 am Post subject: |
|
|
Acolyte
Joined: 11 Feb 2002 Posts: 56
|
Greg,
On AIX, you can look at sysout from java compute node in following place:
/var/mqsi/components/[BROKER_NAME]/[DataFlowEngine_UUID]/stdout
Not sure of path in windows environment, but it should be something like %MQSI_REGISTRY%\components\[BRKR] . . . |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|