I have these routes:
@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));
}
Rest service endpoint:
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);
}
}
Context : The main route overviewRoute is called from a ws REST endpoint. The others routes are called according to when clause.
My front end calls the main route multiple times in parallel.
What I see: All routes defined in "choice" clause are called sequentially (The next route is called once the previous one has finished).
What I want: I want that the route defined in choice clause must be called as soon as a ws called is done and not once the previous call is done.
What I have tried: Apache seda Spring Scope: @Scope(BeanDefinition.SCOPE_PROTOTYPE)