public
Last active

Poor Man's Retry (with SI >= 2.2 use a RequestHandlerRetryAdvice)

  • Download Gist
context.xml
XML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
<int:channel id="requestChannel">
<int:dispatcher load-balancer="none"/> <!-- always first subscriber first -->
</int:channel>
 
<int:bridge order="1" input-channel="requestChannel" output-channel="toHttp" />
<int-http:outbound-gateway request-channel="toHttp"
url="http://localhost:18080/http/receiveGateway"
http-method="POST"
expected-response-type="java.lang.String"/>
 
<int:service-activator order="2" input-channel="requestChannel" output-channel="toHttp">
<int-groovy:script>
println "Failure, sleeping for 5"
Thread.sleep 5000
payload
</int-groovy:script>
</int:service-activator>
 
<int:service-activator order="3" input-channel="requestChannel" output-channel="toHttp">
<int-groovy:script>
println "Failure, sleeping for 10"
Thread.sleep 10000
payload
</int-groovy:script>
</int:service-activator>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.