本文整理汇总了Java中org.apache.camel.RecipientList类的典型用法代码示例。如果您正苦于以下问题:Java RecipientList类的具体用法?Java RecipientList怎么用?Java RecipientList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RecipientList类属于org.apache.camel包,在下文中一共展示了RecipientList类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: listen
import org.apache.camel.RecipientList; //导入依赖的package包/类
@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;
}
示例2: route
import org.apache.camel.RecipientList; //导入依赖的package包/类
@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"};
}
}
示例3: handleError
import org.apache.camel.RecipientList; //导入依赖的package包/类
@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";
}
}
示例4: doSomething
import org.apache.camel.RecipientList; //导入依赖的package包/类
@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"};
}
示例5: route
import org.apache.camel.RecipientList; //导入依赖的package包/类
@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"};
}
}
示例6: route
import org.apache.camel.RecipientList; //导入依赖的package包/类
@RecipientList(strategyRef = "myStrategy", parallelProcessing = true, timeout = 1000)
public String[] route(String body) {
return new String[] {"direct:a", "direct:b", "direct:c"};
}
示例7: doSomething
import org.apache.camel.RecipientList; //导入依赖的package包/类
@RecipientList
public String doSomething() {
return "async:hi:camel,direct:foo";
}
示例8: doSomething
import org.apache.camel.RecipientList; //导入依赖的package包/类
@RecipientList
public String doSomething() {
return "async:bye:camel";
}
示例9: doSomething
import org.apache.camel.RecipientList; //导入依赖的package包/类
@RecipientList
public String doSomething() {
return "async:hi:camel,async:hi:world,direct:foo";
}
示例10: route
import org.apache.camel.RecipientList; //导入依赖的package包/类
@RecipientList
@Consume(uri = "direct:inbound")
public List<String> route() {
return Arrays.asList("mock:outbound1", "mock:outbound2");
}
示例11: route
import org.apache.camel.RecipientList; //导入依赖的package包/类
@Consume(uri = "direct:start")
@RecipientList
public String[] route(String body) {
return new String[]{"mock:a", "mock:b"};
}
示例12: route
import org.apache.camel.RecipientList; //导入依赖的package包/类
@RecipientList
public String[] route() {
return new String[] { "direct:one", "direct:two" };
}