I am connecting to a GET REST service thorugh http outbound gateway. The following code snippent is from the spring integration XML
<http:outbound-gateway request-channel="dispatcherchannel"
http-method="GET"
url="http://ip:port/cacheAPI/Cache/fetch?employeeNumber={employeeNumber}"
reply-channel="outboundreplychannel"
expected-response-type="com.service.Employees">
<http:uri-variable name="empoyeeNumber" expression="payload"/>
</http:outbound-gateway>
I want to know how to set retry mechanism in this gateway so that if the rest service gives a bad response code like 400/500/404 , the oubound gateway should be able to retry automatically for a particular set number of times till it finally errors out.
Can I get a implemented sample for my reference?
Thanks!
you case its already handle by Spring and you can achieve through
I think the parameters is pretty clear, max attempts the number of attempts recovery channel where you want to resend the message. the inner element is for waiting time