Skip to content

Instantly share code, notes, and snippets.

@garyrussell
Last active December 22, 2015 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garyrussell/6393239 to your computer and use it in GitHub Desktop.
Save garyrussell/6393239 to your computer and use it in GitHub Desktop.
Poor Man's Retry (with SI >= 2.2 use a RequestHandlerRetryAdvice)
<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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment