Hello all,
I am looking for a way to have a different redeliveryPolicy in Case the HTTP
statusCode is '503'.
I guess, I could do a try/catch finally every time I make a HTTP-Request. My
hope was to make that switch at one position, for all routes.
Does anyone have a thought on this problem.
This is what I have tried:
<onException>
<exception>org.apache.camel.component.http.HttpOperationFailedException</exception>
<process ref="getHttpStatus"/>
<choice>
<when>
<simple>${exchangeProperty[errorStatusCode]} == '503'</simple>
<throwException ref="ServiceNotAvailableException"/>
</when>
<otherwise>
<throwException ref="HttpErrorException"/>
</otherwise>
</choice>
</onException>
<onException>
<exception>de.cit.eg.transfer.exception.ServiceTemporarilyNotAvailableException</exception>
<redeliveryPolicy asyncDelayedRedelivery="true"
redeliveryDelay="3600000" maximumRedeliveries="3" logRetryAttempted="true"
logNewException="false" retryAttemptedLogLevel="WARN"
backOffMultiplier="4"/>
<to
uri="log:configLogger?level=ERROR&showProperties=true&showException=true&showCaughtException=true&showStackTrace=true&multiline=true"/>
</onException>
<onException>
<exception>de.cit.eg.transfer.exception.DefaultHttpException</exception>
<to
uri="log:configLogger?level=ERROR&showProperties=true&showException=true&showCaughtException=true&showStackTrace=true&multiline=true"/>
</onException>
With regards
--
View this message in context:
http://camel.465427.n5.nabble.com/redeliveryPolicy-onException-based-on-HTTP-statusCode-tp5771448.html
Sent from the Camel - Users mailing list archive at Nabble.com.