java - 路由中的apache骆驼多线程
问题描述
我有这些路线:
@Override
public void configure() throws Exception {
String overviewRoute = this.routingProperties.getReportingRoute(OverviewtRouteConstants.OVERVIEW);
this.from(overviewRoute).routeId(overviewRoute).threads(1, 100).choice()
.when(this.simple(BODY_GRAPH_NAME + GraphConstants.OVERVIEW_OPEN_LANE + "'"))
.to(this.routingProperties.getReportingRoute(OVERVIEW_OPENLANES_TO))
.when(this.simple(BODY_GRAPH_NAME + GraphConstants.OVERVIEW_BELT_DOWNTIME + "'"))
.to(this.routingProperties.getReportingRoute(OVERVIEW_BELTDOWNTIME_TO))
.when(this.simple(BODY_GRAPH_NAME + GraphConstants.OVERVIEW_LUGGAGE_THROUGHPUT + "'"))
.to(this.routingProperties.getReportingRoute(OVERVIEW_LUGGAGETHROUGHPUT_TO))
.when(this.simple(BODY_GRAPH_NAME + GraphConstants.OVERVIEW_LANE_UTILIZATION + "'"))
.to(this.routingProperties.getReportingRoute(OVERVIEW_LUGGAGETHROUGHPUT_TO))
.when(this.simple(BODY_GRAPH_NAME + GraphConstants.OVERVIEW_LUGGAGE_SCANNED + "'"))
.to(this.routingProperties.getReportingRoute(OVERVIEW_LUGGAGESCANNED_TO));
}
休息服务端点:
import javax.ws.rs.core.Response;
import org.springframework.stereotype.Service;
@Service(SERVICE_NAME)
public class OverviewServicesImpl extends BaseServices implements OverviewServices {
@Override
public Response overview(OverviewSearchDTO dto) {
return this.executeRouting(OverviewtRouteConstants.OVERVIEW, dto);
}
}
上下文:主路由概览路由是从 ws REST 端点调用的。其他路由根据when子句调用。
我的前端并行多次调用主路由。
我所看到的:“选择”子句中定义的所有路由都是按顺序调用的(一旦前一个路由完成,就会调用下一个路由)。
我想要什么:我希望一旦调用了 ws 就必须调用在选择子句中定义的路由,而不是在前一次调用完成后调用。
我尝试过:Apache seda Spring Scope:@Scope(BeanDefinition.SCOPE_PROTOTYPE)
解决方案
听起来所有.when
子句都返回 True,所以它遵循所有选择。我不确定您的.when
条款中的部分是实际比较吗?我是否错过了您如何进行比较以检查消息的某些部分以在基于上下文的路由器中进行比较和路由?
推荐阅读
- powershell - 在电子邮件正文中显示图像
- python - 如何使用 Pandas 删除出现在所有行中的行值
- python - 用于将 CSV 转换为 JSON 以与 Auth0 一起使用的 Python 脚本在系统升级后出现问题
- windows - netcat 在批处理文件中将其作为单独的进程运行
- nginx - 无法应用 Nginx 入口控制器
- navigation - 错误类型错误:未定义不是对象(评估'navigation.navigate'
- database - 如何在选择下拉列表时运行数据库内容检查
- javascript - AWS Lambda - 只有在第二次测试触发后才能得到答案
- html - 如何缩进段落,但排除某些行进行格式化?
- javascript - 将内部标签转移到父标签