Retry JMS queue implementation to deliver failed messages after certain interval of time

萝らか妹 提交于 2020-01-06 16:22:23

问题


I am sending the SOAP messages to external service using webservice call. Sometimes external webservice is down so I don't want to lose those failed messages. I push those failed messages to one jms queue designated as retry queue.

Now my requirement is that I have to implement a mechanism to process failed messages from retry queue after some time(lets say half an hour) and try to deliver again to webservice. I should be using fix number of attempts at the interval of half an hour. If I don;t succeed after fixed number of attempts, I should put the message in dead letter queue.

I need help in implementing this requirement.

As the initial step in this direction, I tried use jms polling on retry queue and set the polling interval half an hour. This jms polling jobs wakes up every half an hour and process all the messages present in retry queue. The drawback with this approach is, it tries to redeliver the failed message as soon as it receives for the first time. For subsequent messages, it works fine. Due to this when some message is failed and I put that message in retry queue, it tries to redeliver that message immediately.

来源:https://stackoverflow.com/questions/17838222/retry-jms-queue-implementation-to-deliver-failed-messages-after-certain-interval

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