org.apache.camel.RoutingSlip Java Examples

The following examples show how to use org.apache.camel.RoutingSlip. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SlipBean.java    From camelinaction2 with Apache License 2.0 5 votes vote down vote up
@RoutingSlip
public String slip(String body) {
    // always include A
    String answer = "mock:a";

    // extra step if we are cool
    if (body.contains("Cool")) {
        answer += ",mock:b";
    }

    // and always include C as well
    answer += ",mock:c";
    return answer;
}
 
Example #2
Source File: SlipBean.java    From camelinaction with Apache License 2.0 5 votes vote down vote up
@RoutingSlip
public String slip(String body) {
    // always include A
    String answer = "mock:a";

    // extra step if we are cool
    if (body.contains("Cool")) {
        answer += ",mock:b";
    }

    // and always include C as well
    answer += ",mock:c";
    return answer;
}
 
Example #3
Source File: RoutingSlipAnnotated.java    From camel-cookbook-examples with Apache License 2.0 5 votes vote down vote up
@Consume(uri = "direct:start")
@RoutingSlip(delimiter = ",")
public List<String> routeMe(String body, @Headers Map<String, Object> headers) {
    ArrayList<String> results = new ArrayList<String>();

    Object slip = headers.get("myRoutingSlipHeader");
    if (slip != null) {
        String[] uris = slip.toString().split(",");
        Collections.addAll(results, uris);
    }

    results.add("mock:oneMore");

    return results;
}