@Override public void configure() throws Exception { onException(Throwable.class).logStackTrace(true); createCamelContext(); from("timer:simple?period=" + period) .process(new OpenwireProducerConsumerExample.MessageProducerProcessor("openwire")) .to("jms:openwire.example") .onException(Throwable.class) .maximumRedeliveries(2) .redeliveryDelay(1000); from("jms:openwire.example?consumer.bridgeErrorHandler=true") .to("stream:out") .onException(Throwable.class) .maximumRedeliveries(-1); }
@Override public void configure() throws Exception { getContext().setTracing(true); // general error handler errorHandler(defaultErrorHandler() .maximumRedeliveries(5) .redeliveryDelay(2000) .retryAttemptedLogLevel(LoggingLevel.WARN)); // in case of a http exception then retry at most 3 times // and if exhausted then upload using ftp instead onException(HttpOperationFailedException.class).maximumRedeliveries(3) .handled(true) // use file instead of ftp as its easier to play with .to("file:target/ftp/upload"); // poll files every 5th second and send them to the HTTP server from("file:target/rider?delay=5000&readLock=none") .to("http://localhost:8765/rider"); } }
@Override public void configure() throws Exception { getContext().setTracing(true); // general error handler errorHandler(defaultErrorHandler() .maximumRedeliveries(5) .redeliveryDelay(2000) .retryAttemptedLogLevel(LoggingLevel.WARN)); // in case of a http exception then retry at most 3 times // and if exhausted then upload using ftp instead onException(IOException.class, HttpOperationFailedException.class) .maximumRedeliveries(3) .handled(true) .to(ftp); // poll files send them to the HTTP server from(file).to(http); }
@Override public void configure() throws Exception { getContext().setTracing(true); // general error handler errorHandler(defaultErrorHandler() .maximumRedeliveries(5) .redeliveryDelay(2000) .retryAttemptedLogLevel(LoggingLevel.WARN)); // in case of a http exception then retry at most 3 times // and if exhausted then upload using ftp instead onException(IOException.class, HttpOperationFailedException.class) .maximumRedeliveries(3) .handled(true) .to(ftp); // poll files send them to the HTTP server from(file).to(http); }
@Override public void configure() throws Exception { getContext().setTracing(true); // general error handler errorHandler(defaultErrorHandler() .maximumRedeliveries(5) .redeliveryDelay(2000) .retryAttemptedLogLevel(LoggingLevel.WARN)); // in case of a http exception then retry at most 3 times // and if exhausted then upload using ftp instead onException(HttpOperationFailedException.class).maximumRedeliveries(3) .handled(true) // use file instead of ftp as its easier to play with .to("file:target/ftp/upload"); // poll files every 5th second and send them to the HTTP server from("file:target/rider?delay=5000&readLock=none") .to("http://localhost:8765/rider"); } }
@Override public void configure() throws Exception { from("xds-iti41:continuaHRNService") .onException(Exception.class) .maximumRedeliveries(0) .end() .process(ContinuaHrnCamelProcessors.continuaHrnRequestTransformerAndValidator()) .process(CHECK_PROCESSOR) .setBody(constant(new Response(Status.SUCCESS))) .process(ContinuaHrnCamelProcessors.continuaHrnResponseValidator()); }
.errorHandler(deadLetterChannel(dlq)) .onException(SmppException.class) .maximumRedeliveries(0) .end() .removeHeaders("CamelSmpp*")//In case it started as SMS elsewhere
onException(CannotAcquireLockException.class, JpaSystemException.class) //due to our transaction isolation, we may have to retry .log(LoggingLevel.INFO, "re-delivering the current message because of an exception, wonMessage header: ${header." + WonCamelConstants.MESSAGE_HEADER +"}") .maximumRedeliveries(2) .redeliveryDelay(1000) .handled(true)
.maximumRedeliveries("{{error.maxRedeliveries}}") .log("Event Routing Error: ${routeId}");