Skip to content
Advertisement

How to handle 4xx(without retry) and 5xx (with retry) exceptions in camel

I’ve a camel route which makes API request, the external service may though 4xx or 5xx. I have written HttpOperationFailedException handler to handle all HTTP related exception and I’m retrying all the Http exceptions irrespective of whether its client side or server side exceptions. I would like to handle them in a way, I need to avoid the reties for client side exceptions.

Here is my route and exception code, looks like. Can anyone suggest best way to handle these scenarios ?

JavaScript

Advertisement

Answer

You could try something along the lines of:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement