@Override public void configure() throws Exception { from("direct:start") .filter(header("userStatus").isEqualTo("valid")) .to("mock:valid") .end() .to("mock:all"); }
@Override public void configure() throws Exception { from("direct:start") .split(xpath("//invoice/item/product")) .convertBodyTo(String.class) .to("mock:products") .end() .to("mock:result"); } }
.end() // end delay -- see comment below delay(...).
private void addThrottling(TryDefinition route) { Throttling throttling = _reference.getServiceMetadata().getThrottling(); long timePeriodMS = throttling != null ? throttling.getTimePeriod() : Throttling.DEFAULT_TIME_PERIOD; route.filter(THROTTLE_CHECK) .throttle(header(Throttling.MAX_REQUESTS)).timePeriodMillis(timePeriodMS) // throttle needs a child process, so we'll just remove the header // using an empty process definition causes some of the interceptors // to blow chunks, specifically audit interceptors .removeHeader(Throttling.MAX_REQUESTS) .end().end(); } }
private void addThrottling(TryDefinition route) { Throttling throttling = _reference.getServiceMetadata().getThrottling(); long timePeriodMS = throttling != null ? throttling.getTimePeriod() : Throttling.DEFAULT_TIME_PERIOD; route.filter(THROTTLE_CHECK) .throttle(header(Throttling.MAX_REQUESTS)).timePeriodMillis(timePeriodMS) // throttle needs a child process, so we'll just remove the header // using an empty process definition causes some of the interceptors // to blow chunks, specifically audit interceptors .removeHeader(Throttling.MAX_REQUESTS) .end().end(); } }
@Override public void configure() throws Exception { // this is the webservice route which is started last from("cxf:bean:inventoryEndpoint") .routeId("webservice").startupOrder(3) .to("direct:update") .transform().method("inventoryService", "replyOk"); // this is the file route which is started 2nd last from("file://target/inventory/updates") .routeId("file").startupOrder(2) .split(body().tokenize("\n")) .convertBodyTo(UpdateInventoryInput.class) .to("direct:update") .end(); // this is the shared route which then must be started first from("direct:update") .routeId("update").startupOrder(1) .to("bean:inventoryService?method=updateInventory"); } }
@Override public void configure() throws Exception { // this is the webservice route which is started last from("cxf:bean:inventoryEndpoint") .routeId("webservice").startupOrder(3) .to("direct:update") .transform().method("inventoryService", "replyOk"); // this is the file route which is started 2nd last from("file://target/inventory/updates") .routeId("file").startupOrder(2) .split(body().tokenize("\n")) .convertBodyTo(UpdateInventoryInput.class) .to("direct:update") .end(); // this is the shared route which then must be started first from("direct:update") .routeId("update").startupOrder(1) .to("bean:inventoryService?method=updateInventory"); } }
@Override public void configure() throws Exception { // this is the webservice route which is started last from("cxf:bean:inventoryEndpoint") .routeId("webservice").startupOrder(3) .to("direct:update") .transform().method("inventoryService", "replyOk"); // this is the file route which is started 2nd last from("file://target/inventory/updates") .routeId("file").startupOrder(2) .split(body().tokenize("\n")) .convertBodyTo(UpdateInventoryInput.class) .to("direct:update") .end(); // this is the shared route which then must be started first from("direct:update") .routeId("update").startupOrder(1) .to("bean:inventoryService?method=updateInventory"); } }