Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
  • Complex non XML/String Transforms

    Posted on

    Hello,

    Still learning, please overlook some of my newbie-'isms....

    Here is my scenario:
    Trying to use Switchyard Camel Netty service binding to provide a connector to a legacy C++ Socket based messaging system. I've been successful in using standalone Camel to create a netty route using a decoder to retrieve the byte[] and generate my POJO:

    public class MessageDecoder extends FrameDecoder {
    @Override
    protected Object decode(ChannelHandlerContext ctx, Channel channel,
    ChannelBuffer buffer) throws Exception {

    // buffer.skipBytes(4);//(3)
    byte[] decoded = new byte[buffer.readableBytes()];
    buffer.readBytes(decoded);
    String msg = new String(decoded);// (4)
    System.out.println("Decoded msg: " + msg);
    TrainnerCommon aTrainnerCommon = new TrainnerCommon();
    aTrainnerCommon.setMsgID(1234);
    aTrainnerCommon.setMsg(msg.getBytes());
    System.out.println("Trainer Object: " + aTrainnerCommon);
    return aTrainnerCommon;
    }
    

    }

    For the life of me, I cannot figure out how to produce this into Fuse Service Works using Switchyard. I seems like 'natively' all the bindings and their transforms are expecting String and formatted XML 'payloads'!?! Found some examples using what appears to be just Fuse using an @Converter annotation, ie:

    @Converter
    public IFacadeMessage toIFacadeMessage(byte[] data, Exchange exchange) {
    ...
    }

    But cannot figure out how, via Switchyard to do the same as Fuse or standalone Camel?!?

    To do this type of binding and service am I going to have to use a Camel URI using decoder??

    Any help is very appreciated!

    ===========================
    2015-02-19
    Adding Screen grab of Debugger variables in the Composer

    Attachments

    by

    points

    Responses

    Red Hat LinkedIn YouTube Facebook X, formerly Twitter

    Quick Links

    Help

    Site Info

    Related Sites

    © 2026 Red Hat