@Override public void configure() throws Exception { weaveAddLast().to(mockEndpointURI); } });
@Override public void configure() throws Exception { weaveById(processorId).replace().to("mock:"+processorId); } });
@Override public Optional<ProcessorDefinition> handle(Endpoint step, ProcessorDefinition route, SyndesisRouteBuilder routeBuilder) { final String uri = buildUri(step); if (!Strings.isEmpty(uri)) { if (route == null) { route = routeBuilder.from(uri); } else { route = route.to(uri); } } return Optional.of(route); }
public void configure() { from("timer://myTimer?period=2000") .setBody().simple("Current time is ${header.firedTime}") .to("stream:out"); } });
@Override public void configure() throws Exception { from("timer://myTimer?period=2s").setBody().simple("Current time is ${header.firedTime}") .to("log:CamelTimerServer?showExchangeId=true"); } });
@Override public void configure() { from("timer:trigger?delay=500") .transform().simple("ref:myBean") .to("log:out"); }
public void configure() { from("quartz://myTimer?trigger.repeatInterval=2000&trigger.repeatCount=-1") .setBody().simple("I was fired at ${header.fireTime}") .to("stream:out"); } });
public void configure() { from("quartz://report?cron=0/2+*+*+*+*+?") .setBody().simple("I was fired at ${header.fireTime}") .to("stream:out"); } });
@Override public void configure() { from("timer://myTimer?period=1000") .setBody() .simple("Darth Vader coming at ${header.firedTime}") .to("stream:out"); } });
@Override public void configure() throws Exception { from("timer:foo?period=5000") .setBody().simple("Hello ERP calling at ${date:now:HH:mm:ss}") .to("erp:foo") .to("log:reply"); } }
@Override public void configure() throws Exception { from("timer:foo?period=5000") .setBody().simple("Hello ERP calling at ${date:now:HH:mm:ss}") .to("erp:foo") .to("log:reply"); } }
public void configure() { from("file:data/inbox?noop=true") .unmarshal() .json(JsonLibrary.Gson) .process(exchange -> { System.out.format(" %s%n", exchange.getIn().getBody()); }) .filter(body().convertToString().contains("uke")) .marshal() .json(JsonLibrary.Gson) .to("file:data/outbox"); } });
@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") .multicast(new HighestQuoteAggregator()) .parallelProcessing() .to("mock:a", "mock:b", "mock:c") .end() .to("mock:result"); }
@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 { from("file://in").id("file2jms") .to("jms:person"); from("jms:person").id("personJms2Rest") // .onException(ConnectException.class).log("Exception processing message.. does the personservice run?").end() .setHeader("person_id", xpath("/person/id").stringResult()) .to("log:test") .setHeader(Exchange.HTTP_METHOD, constant("PUT")) .setHeader(Exchange.CONTENT_TYPE, constant("text/xml")) .setHeader(Exchange.HTTP_URI, simple("${properties:personServiceUri}/${header.person_id}")) // .to("http://dummy"); }
@Override public void configure() throws Exception { from("file:gutenberg?recursive=true&noop=true") .bean(new BookParser()) .marshal().jaxb(true) .to("jms:books.in"); from("jms:books.in") .transacted() .bean(bookRepo, "add") .bean(new BookLogger()); }
@Override public void configure() throws Exception { from("timer://myTimer?period=2000") .setBody().constant(jsonBody) .to("sql-connector:" + insertStatement) .process(new Processor() { @Override public void process(Exchange exchange) throws Exception { result.setJsonBean(exchange.getIn().getBody(String.class)); latch.countDown(); } }).to("stream:out"); } });
@Override public void configure() throws Exception { // global error handler errorHandler(noErrorHandler()); from("direct:input-1") .to("mock:inter") // inherits global error handler (step in pipeline) .process(failure) // inherits global error handler (step in pipeline) .to("mock:output"); // inherits global error handler (step in pipeline) from("direct:input-2") // defines local error handler (placed before every node in this route) .errorHandler(defaultErrorHandler().maximumRedeliveries(2)).to("mock:error") .onException(Exception.class).handled(false).end() .to("mock:inter") // no redeliveries here .to("direct:temp"); // the error handler of this node redelivers from("direct:temp") .to("mock:check") // inherits global error handler (step in pipeline) .process(failure) // inherits global error handler (step in pipeline) .to("mock:output"); // inherits global error handler (step in pipeline) }
@Override public void configure() throws Exception { from("direct:input") // Enable the following statement if error handling // has been globally turned off via noErrorHandler(), // otherwise exception() statements have no effect. //.errorHandler(deadLetterChannel()) .onException(Exception1.class).to("mock:error1").end() .onException(Exception2.class).to("mock:error2").end() .onException(Exception.class).to("mock:error3").end() .process(exceptionProcessor()) .to("mock:success"); }