0

I have configured the re delivery related properties as follows. In fact, I wanted to retry only for HTTP Code 500x series. But I see that onException() takes only exception type. How to achieve this? My application is spring boot & camel based.

errorHandler(defaultErrorHandler().maximumRedeliveries(3).redeliveryDelay(5000).logRetryAttempted(true).logExhausted(true));

onException().retryAttemptedLogLevel(LoggingLevel.WARN)

Camel 2.23 is the version I am using(As per the comment).

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
mac
  • 543
  • 1
  • 6
  • 17

1 Answers1

0

Need more information, how you get resp code.
if you get response from camel route you can add condition in route:

.choice().when().simple("header.HTTP_RESPONSE_CODE >= 500").errorHandler(defaultErrorHandler().maximumRedeliveries(3).redeliveryDelay(5000).logRetryAttempted(true).logExhausted(true)).end();
  • Hi Anatoly, Thanks for the reply. Here .errorHandler does not seem to be available after simple() expression. This is what I am trying to do. from("C:/IN") .process(new RequestMessageProcessor()) .to("http://localhost:8090/getItem") .process(new ResponseMessageProcessor()) .to("C:/OUT")) – mac Dec 19 '18 at 06:38