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 » Java Plug-in Node - Message propagated length 0

Post new topic  Reply to topic
 Java Plug-in Node - Message propagated length 0 « View previous topic :: View next topic » 
Author Message
fcotait
PostPosted: Wed Dec 01, 2004 5:55 pm    Post subject: Java Plug-in Node - Message propagated length 0 Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Java Plug-in Node - Message propagated length 0
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.