@Override public void configure() throws Exception { // this is the webservice route which is started last from("cxf:bean:inventoryEndpoint") .routeId("webservice").startupOrder(2) .to("direct:update") .transform().method("inventoryService", "replyOk"); // 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 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"); // 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") .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") .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 { JaxbDataFormat jaxb = new JaxbDataFormat(); jaxb.setContextPath("camelinaction"); // TODO: due activemq bug we need to configure it here also ActiveMQComponent jms = new ActiveMQComponent(getContext()); jms.setBrokerURL("tcp://localhost:61616"); getContext().addComponent("jms", jms); from("direct:inventory") .log("Calling inventory service using JMS") .hystrix() // call the legacy system using JMS .to("jms:queue:inventory") // the returned data is in XML format so convert that to POJO using JAXB .unmarshal(jaxb) .onFallback() .log("Circuit breaker failed so using fallback response") // fallback and read inventory from classpath which is in XML format .transform().constant("resource:classpath:fallback-inventory.xml"); }
@Override public void configure() throws Exception { JaxbDataFormat jaxb = new JaxbDataFormat(); jaxb.setContextPath("camelinaction"); // TODO: due activemq bug we need to configure it here also ActiveMQComponent jms = new ActiveMQComponent(getContext()); jms.setBrokerURL("tcp://localhost:61616"); getContext().addComponent("jms", jms); from("direct:inventory") .log("Calling inventory service using JMS") .hystrix() // call the legacy system using JMS .to("jms:queue:inventory") // the returned data is in XML format so convert that to POJO using JAXB .unmarshal(jaxb) .onFallback() .log("Circuit breaker failed so using fallback response") // fallback and read inventory from classpath which is in XML format .transform().constant("resource:classpath:fallback-inventory.xml"); }