Java 类org.apache.camel.RecipientList 实例源码

项目:Camel    文件:DistributeRecordsBean.java   
@Consume(uri = "activemq:personnel.records")
@RecipientList
public String[] route(@XPath("/person/city/text()") String city) {
    if (city.equals("London")) {
        LOG.info("Person is from EMEA region");
        return new String[] {"file:target/messages/emea/hr_pickup", 
                             "file:target/messages/emea/finance_pickup"};
    } else {
        LOG.info("Person is from AMER region");
        return new String[] {"file:target/messages/amer/hr_pickup",
                             "file:target/messages/amer/finance_pickup"};
    }
}
项目:Camel    文件:DeadLetterChannelRestartFromBeginningTest.java   
@RecipientList
public String handleError(Exchange exchange) {
    // store a property on the exchange with the number of total attempts
    int attempts = exchange.getProperty("attempts", 0, int.class);
    attempts++;
    exchange.setProperty("attempts", attempts);

    // we want to retry at most 4 times
    if (attempts <= 4) {
        return "seda:retry";
    } else {
        // okay we give up its a poison message
        return "log:giveup";
    }
}
项目:Camel    文件:RoutePojo.java   
@Consume(uri = "activemq:queue:inbox?concurrentConsumers=10")
@RecipientList
public String listen(Exchange exchange) {
    topic.send(exchange);

    String type = exchange.getIn().getHeader("type", String.class);
    return "direct:" + type;
}
项目:Camel    文件:MyCamel2RecipientList.java   
@Consume(uri = "direct:foo", context = "camel-2")
@RecipientList(context = "camel-2")
public String[] doSomething(String body) {
    LOG.info("Received body: " + body);

    return new String[]{"mock:foo", "mock:result"};
}
项目:camelinaction2    文件:AnnotatedRecipientList.java   
@RecipientList
public String[] route(@XPath("/order/@customer") String customer) {
    if (isGoldCustomer(customer)) {
        return new String[] {"jms:accounting", "jms:production"};
    } else {
        return new String[] {"jms:accounting"};
    }
}
项目:camelinaction    文件:RecipientListBean.java   
@RecipientList
public String[] route(@XPath("/order/@customer") String customer) {
    if (isGoldCustomer(customer)) {
        return new String[] {"jms:accounting", "jms:production"};
    } else {
        return new String[] {"jms:accounting"};
    }
}
项目:t4f-data    文件:RecipientListBean.java   
@RecipientList
public String[] route(@XPath("/order/@customer") String customer) {
    if (isGoldCustomer(customer)) {
        return new String[] {"jms:accounting", "jms:production"};
    } else {
        return new String[] {"jms:accounting"};
    }
}
项目:Camel    文件:BeanRecipientListTimeoutTest.java   
@RecipientList(strategyRef = "myStrategy", parallelProcessing = true, timeout = 1000)
public String[] route(String body) {
    return new String[] {"direct:a", "direct:b", "direct:c"};
}
项目:Camel    文件:AsyncEndpointRecipientListBean3Test.java   
@RecipientList
public String doSomething() {
    return "async:hi:camel,direct:foo";
}
项目:Camel    文件:AsyncEndpointRecipientListBeanTest.java   
@RecipientList
public String doSomething() {
    return "async:bye:camel";
}
项目:Camel    文件:AsyncEndpointRecipientListBean4Test.java   
@RecipientList
public String doSomething() {
    return "async:hi:camel,async:hi:world,direct:foo";
}
项目:Camel    文件:RecipientListMethodBean.java   
@RecipientList
@Consume(uri = "direct:inbound")
public List<String> route() {
    return Arrays.asList("mock:outbound1", "mock:outbound2");
}
项目:Camel    文件:RouterBean.java   
@Consume(uri = "direct:start")
@RecipientList
public String[] route(String body) {
    return new String[]{"mock:a", "mock:b"};
}
项目:camel-cdi    文件:RecipientListMethodBean.java   
@RecipientList
@Consume(uri = "direct:inbound")
public List<String> route() {
    return Arrays.asList("mock:outbound1", "mock:outbound2");
}
项目:wildfly-camel    文件:RecipientListBean.java   
@RecipientList
public String[] route() {
    return new String[] { "direct:one", "direct:two" };
}