java - How can I send and acquire an object from a connector in Mule Studio? -
i need send , acquire java object custom connector expecting:
// inside myconnector.java @processor public object dosomething(@default(#[payload]) final object data) {...}
i'm trying send instance of fakedata class. can verify works when send object using mule's functionaltestcase class:
<!-- inside mule-config.xml --> <flow name="do_something"> <myconnector:do-something document-ref="#[payload]"/> </flow> public class flowbuilder extends functionaltestcase { public void run() { object payload = new fakedata(); flow flow = lookupflowconstruct("do_something"); muleevent event = functionaltestcase.gettestevent(payload); muleevent responseevent= flow.process(event); } }
i can't figure out how send fakedata object , receive object in regular mule flow using mule studio.
can me out?
------- update --------
i invoking flow using http front end. flow looks this:
[http] -> [java "my transformer"] -> [custom connector]
i tried adding transformer in front of connector:
public class mytransformer extends abstractmessagetransformer { @override public object transformmessage(mulemessage message, string outputencoding) throws transformerexception { return new fakedata(); } }
now response:
could not find transformer transform "simpledatatype{type=org.mule.example.fakedata, mimetype='*/*'}" "simpledatatype{type=org.mule.api.transport.outputhandler, mimetype='*/*'}". (org.mule.api.transformer.transformerexception) (org.mule.api.transformer.transformerexception). message payload of type: fakedata
in flow, can like:
<set-payload value="#[new org.mule.example.fakedata()]" />
edit: you've modified question , added http inbound endpoint. error you're getting because inbound http endpoint request-response
, haven't transformed org.mule.example.fakedata
streamed on http.
Comments
Post a Comment