本文整理汇总了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;
}
开发者ID:HydAu,项目名称:Camel,代码行数:9,代码来源:RoutePojo.java
示例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"};
}
}
开发者ID:HydAu,项目名称:Camel,代码行数:14,代码来源:DistributeRecordsBean.java
示例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";
}
}
开发者ID:HydAu,项目名称:Camel,代码行数:16,代码来源:DeadLetterChannelRestartFromBeginningTest.java
示例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"};
}
开发者ID:HydAu,项目名称:Camel,代码行数:8,代码来源:MyCamel2RecipientList.java
示例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"};
}
}
开发者ID:camelinaction,项目名称:camelinaction2,代码行数:9,代码来源:AnnotatedRecipientList.java
示例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"};
}
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:BeanRecipientListTimeoutTest.java
示例7: doSomething
import org.apache.camel.RecipientList; //导入依赖的package包/类
@RecipientList
public String doSomething() {
return "async:hi:camel,direct:foo";
}
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:AsyncEndpointRecipientListBean3Test.java
示例8: doSomething
import org.apache.camel.RecipientList; //导入依赖的package包/类
@RecipientList
public String doSomething() {
return "async:bye:camel";
}
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:AsyncEndpointRecipientListBeanTest.java
示例9: doSomething
import org.apache.camel.RecipientList; //导入依赖的package包/类
@RecipientList
public String doSomething() {
return "async:hi:camel,async:hi:world,direct:foo";
}
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:AsyncEndpointRecipientListBean4Test.java
示例10: route
import org.apache.camel.RecipientList; //导入依赖的package包/类
@RecipientList
@Consume(uri = "direct:inbound")
public List<String> route() {
return Arrays.asList("mock:outbound1", "mock:outbound2");
}
开发者ID:HydAu,项目名称:Camel,代码行数:6,代码来源:RecipientListMethodBean.java
示例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"};
}
开发者ID:HydAu,项目名称:Camel,代码行数:6,代码来源:RouterBean.java
示例12: route
import org.apache.camel.RecipientList; //导入依赖的package包/类
@RecipientList
public String[] route() {
return new String[] { "direct:one", "direct:two" };
}
开发者ID:wildfly-extras,项目名称:wildfly-camel,代码行数:5,代码来源:RecipientListBean.java
注:本文中的org.apache.camel.RecipientList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论