Hello, You shouldn't need to set the max retry count to 0 as it is the default. If that is the full log I suspect that is one try, try enabling debug logging or checking the Web servers access togs to confirm. The first two are info then the error stating it tried once. Exhausted after delivery attempt: 1
Can you add log("$(body)") in the onexception definition to print the body? I am not sure it will print the response body, I would be surprised if it didn't. - J On Thu, 13 Oct 2016, 21:25 Val <v...@fispan.com> wrote: > Hello, > > > > Could you please advise why automatic retries happen even if I set > maximumRedeliveries to 0? Basically I just want to disable retries. > > > > And also, how do I print HTTP response body in case it’s an error code? > ${exception} only has a short description that HTTP call to my URL failed > with error code. Server returns details in HTTP response. > > > > onException(Exception.class) > > .maximumRedeliveries(0); > > > > from("direct:send") > > .setHeader(Exchange.HTTP_METHOD, constant("POST")) > > .setHeader(Exchange.CONTENT_TYPE, constant("application/json")) > > .to("http://localhost:8100/") > > .log("${body}"); > > > > In 3 different cases (URL is not available, server code 400 or 500) I get > numerous retries before it finally stop: > > > > 2016-10-12 13:11:57.397 INFO 58522 --- [] > route2 : HTTP operation failed invoking > http://localhost:8100/ with statusCode: 400 > > 2016-10-12 13:11:57.397 INFO 58522 --- [] route2 > : > org.apache.camel.http.common.HttpOperationFailedException: HTTP operation > failed invoking http://localhost:8100/ with statusCode: 400 > > 2016-10-12 13:11:57.399 ERROR 58522 --- [] > o.a.camel.processor.DefaultErrorHandler : Failed delivery for (MessageId: > ID-raptor-local-64577-1476303106751-0-11 on ExchangeId: > ID-raptor-local-64577-1476303106751-0-12). Exhausted after delivery > attempt: 1 caught: > org.apache.camel.http.common.HttpOperationFailedException: HTTP operation > failed invoking http://localhost:8100/ with statusCode: 400. Processed > by failure processor: > FatalFallbackErrorHandler[Pipeline[[Channel[Log(route2)[exchangeExceptionMessage]], > Channel[Log(route2)[exchangeException]]]]] > > > >