public void configure() throws Exception { errorHandler(deadLetterChannel("seda:errors")); // We pool the atom feeds from the source for further processing in the seda queue // we set the delay to 1 second for each pool. // Using splitEntries=true will during polling only fetch one RSS Entry at any given time. from("rss:" + VERTX_BLOG_ATOM + "?splitEntries=true&consumer.delay=100").to("seda:feeds"); from("seda:feeds") // Filter .filter().method("filterService", "isRelease") // Transform (extract) .transform(simple("${body.entries[0].title}")) // Output .to("seda:announce"); } };
@Override public void configure() throws Exception { // read files from the shared directory // url to consume files from String url = "file:target/inbox?delete=true"; // use the zookeeper master component in the clustered group named myGroup // to run a master/slave mode in the following Camel url from("zookeeper-master:myGroup:" + url) .log(name + " - Received file: ${file:name}") .delay(delay) .log(name + " - Done file: ${file:name}") .to("file:target/outbox"); }
@Override public void configure() throws Exception { // read files from the shared directory from("file:target/inbox" + "?delete=true" + "&readLock=idempotent" + // use idempotent read lock "&idempotentRepository=#myRepo" + // refer to the idempotent repository "&readLockLoggingLevel=WARN" + // logging level, you can set this to DEBUG/OFF for production "&shuffle=true") // sort the files by random to reduce the chance of multiple nodes trying to process the same file .log(name + " - Received file: ${file:name}") .delay(delay) .log(name + " - Done file: ${file:name}") .to("file:target/outbox"); }
@Override public void configure() throws Exception { // read files from the shared directory from("file:target/inbox" + "?delete=true") // setup route policy to be used .routePolicyRef("myPolicy") .log(name + " - Received file: ${file:name}") .delay(delay) .log(name + " - Done file: ${file:name}") .to("file:target/outbox"); }
@Override public void configure() throws Exception { // read files from the shared directory from("file:target/inbox" + "?delete=true") // setup route policy to be used .routePolicyRef("myPolicy") .log(name + " - Received file: ${file:name}") .delay(delay) .log(name + " - Done file: ${file:name}") .to("file:target/outbox"); }
@Override public void configure() throws Exception { // read files from the shared directory from("file:target/inbox" + "?delete=true") // setup route policy to be used .routePolicyRef("myPolicy") .log(name + " - Received file: ${file:name}") .delay(delay) .log(name + " - Done file: ${file:name}") .to("file:target/outbox"); }
@Override public void configure() throws Exception { from("seda:orders").id("legacyRoute") .throttle(5).timePeriodMillis(10000).asyncDelayed().id("orderThrottler") .to("seda:legacy"); } }
@Override public void configure() throws Exception { from("direct:start") .split(xpath("//invoice/item/product")) .convertBodyTo(String.class) .to("mock:products") .end() .to("mock:result"); } }
@Override public void configure() throws Exception { // read files from the shared directory // its import to set the route to not auto startup // as we let the route policy start/stop the routes when it becomes a master/slave etc from("file:target/inbox?delete=true").noAutoStartup() // use the zookeeper master route policy in the clustered group // to run this route in master/slave mode .routePolicyRef("zookeeper-master-policy") .log(name + " - Received file: ${file:name}") .delay(delay) .log(name + " - Done file: ${file:name}") .to("file:target/outbox"); }
@Override public void configure() throws Exception { from(inputPath) .routeId(getRouteId()) .split(body().tokenize("\n")) .convertBodyTo(UpdateInventoryInput.class) .to("direct:update"); }
@Override public void configure() throws Exception { // 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"); // 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 { from("jms:queue:factory." + factoryType + ".inbound").routeId(factoryType + "_factory") .setHeader("name", xpath("order/type/text()")) .setHeader("id", xpath("order/id/text()")) .setHeader("amount", xpath("order/amount/text()")) .delay(constant(factoryCosts)) .setHeader(Exchange.HTTP_METHOD, constant("PUT")) .setBody(constant("")) .to("http://" + reportServerHost + ":" + reportServerPort + "/report/services/reporting"); } }
@Override public void configure() throws Exception { from("jms:queue:factory." + factoryType + ".inbound").routeId(factoryType + "_factory") .setHeader("name", xpath("order/type/text()")) .setHeader("id", xpath("order/id/text()")) .setHeader("amount", xpath("order/amount/text()")) .delay(constant(factoryCosts)) .setHeader(Exchange.HTTP_METHOD, constant("PUT")) .setBody(constant("")) .to("http://" + reportServerHost + ":" + reportServerPort + "/report/services/reporting"); } }
@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"); // 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"); // 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"); // 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"); // 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"); // this is the shared route which then must be started first from("direct:update") .routeId("update").startupOrder(1) // we must defer shutting down this route as its a shared route by the two others .shutdownRoute(ShutdownRoute.Defer) .to("bean:inventoryService?method=updateInventory"); } }