Skip to content

Instantly share code, notes, and snippets.

@monodot
Last active March 19, 2016 14:58
Show Gist options
  • Save monodot/6d353aed98d3e7965a4c to your computer and use it in GitHub Desktop.
Save monodot/6d353aed98d3e7965a4c to your computer and use it in GitHub Desktop.
Example Camel-annotated RoutingSlip bean for use in Talend ESB
package beans;
import java.util.ArrayList;
import org.apache.camel.RoutingSlip;
public class CustomRoutingSlipBean {
@RoutingSlip
public ArrayList<String> slip(String body) {
ArrayList<String> recipients = new ArrayList<String>();
if (body.startsWith("premium")) {
recipients.add("cJMSConnectionFactory1:queue:queue.premium");
} else {
recipients.add("cJMSConnectionFactory1:queue:queue.standard");
}
return recipients;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment