|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Java Plug-in Node - Message propagated length 0 |
« View previous topic :: View next topic » |
Author |
Message
|
fcotait |
Posted: Wed Dec 01, 2004 5:55 pm Post subject: Java Plug-in Node - Message propagated length 0 |
|
|
 Acolyte
Joined: 28 Feb 2002 Posts: 63 Location: Sao Paulo - Brazil
|
Hi all,
I created a Java Plug In Node to transform a BLOB to XML.
Everything is working, except the length of the message propagated in que queue is 0 (zero) . In debug mode, it seems is working, because I can navigate in my XML Domain created
Code: |
package com.intvision.websphere.messagebroker.plugins.ISO;
import com.ibm.broker.plugin.MbElement;
import com.ibm.broker.plugin.MbException;
import com.ibm.broker.plugin.MbFatalException;
import com.ibm.broker.plugin.MbInputTerminal;
import com.ibm.broker.plugin.MbMessage;
import com.ibm.broker.plugin.MbMessageAssembly;
import com.ibm.broker.plugin.MbNode;
import com.ibm.broker.plugin.MbNodeInterface;
import com.ibm.broker.plugin.MbOutputTerminal;
public class ISO8583toXMLPluginNode extends MbNode implements MbNodeInterface {
public ISO8583toXMLPluginNode() throws MbException {
createInputTerminal("in");
createOutputTerminal("out");
createOutputTerminal("failure");
}
public static String getNodeName() {
return "ISO8583toXMLPluginNode";
}
public void evaluate(MbMessageAssembly assembly, MbInputTerminal in) throws MbException {
try {
ParserISOtoXML parser = new ParserISOtoXML();
MbMessage newMsg = new MbMessage(assembly.getMessage());
MbElement newRoot = newMsg.getRootElement();
MbMessageAssembly newAssembly = new MbMessageAssembly(assembly, newMsg);
MbElement headers = newRoot.getFirstElementByPath("BLOB");
if ("BLOB".equals(headers.getName())) {
String msg = parser.ISOtoXML(headers.getValue().toString());
headers.detach();
headers.createElementAsLastChild(MbElement.TYPE_NAME, "XML", null);
headers.getFirstElementByPath("XML").createElementAsFirstChild(MbElement.TYPE_VALUE, "XML", msg.getBytes());
//headers.getFirstElementByPath("XML").createElementAsFirstChild(MbElement.TYPE_VALUE, "XML", msg);
}
MbOutputTerminal out = getOutputTerminal("out");
out.propagate(newAssembly);
} catch(MbException e){
e.printStackTrace();
throw new MbFatalException(this, "evaluate", e.getClass().getName(), e.getMessage(), null, null);
}
}
}
|
Any idea ?
Thanks _________________ Filipe Cotait
IBM Certified System Administrator - WebSphere MQ
IBM Certified Specialist - MQSeries, WebSphere MQ Integrator |
|
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
|
|
|
|