How to “own” Mule ESB: Callable

An easy way to inject custom logic in Mule is through implementing “Callable” Java objects and using the Mule Studio Java component.

import org.mule.api.lifecycle.Callable;
import org.mule.api.MuleEventContext;
import org.mule.api.MuleMessage;

public class DoMyStuff implements Callable
{
@Override
public Object onCall(MuleEventContext ec)    throws Exception
{
MuleMessage msg = ec.getMessage();

class payload = msg.getPayload(classname);

payload.manipulate();
return payload ;
}
}

One can also manipulate session variables, flowvars…

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s