Spring integration: Best way to implement retry for remote HTTP calls

荒凉一梦 提交于 2020-02-23 06:23:52

问题


I have channel with queue and it has several messages. All of them should go to the remote system via http-outbound-gateway

If remote system is not available where do my message go? To the nowhere? How can I retry later? Does there is something like "error-channel" for http-outbound-gateway?

PS: I found way I probably like: using transactional chain + PseudoTransactionManager. It works. But could I do it with less XML?


回答1:


See this biog post and the associated sample for using the MessageHandlerRetryAdvice...

http://spring.io/blog/2012/10/09/what-s-new-in-spring-integration-2-2-part-4-retry-and-more

After the retries as exhausted you can send the message to a <delayer/> and then send it through again.



来源:https://stackoverflow.com/questions/13753476/spring-integration-best-way-to-implement-retry-for-remote-http-calls

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!