【发布时间】:2014-09-03 20:04:59
【问题描述】:
我正在使用带有 ActiveMQ 的 Apache Camel,并希望实现有保证的消息传递。
我一直在阅读 Camel in Action 一书以及 Apache Camel Developer's Cookbook。
我希望这里有人可以就我的方法给我建议。我不是要代码示例。
我设想的实现方式如下:
1. Message is received on an endpoint
2. I inspect the message
3. I use the Wiretap pattern to drop it immediately on my "GuaranteedMessages" queue if the message asks for guaranteed delivery
4. I route the message to its proper destination
5. If no exceptions were encountered, I remove the message manually from the "GuaranteedMessages" queue
听起来很简单。但是,我一直在阅读 Camel 中的“死信通道”模式。
我的理解是使用这种模式的实现意味着我不会自动将每条(保证的)消息放到我的“GuaranteedMessages”队列中,而是放弃这种方法,而是设置重新传递选项(最大尝试、指数延迟、重新传递延迟、等等。)。然后,我依靠 Camel 尝试重新传递,如果它永远无法通过,我只需将其放入死信通道延迟中。
然后,我将有一个单独的路由,使用这个死信队列作为它的源。同样,这将是相同的模式。如果不能成功,将消息发送回死信队列。
这听起来像是生产系统的现实实现吗?
如果相反,我决定将每条传入消息(需要保证)放到我自己的“GuaranteeMessage”队列中,那么相信我以后可以手动从队列中删除该特定消息是否现实?我的理解是我必须手动浏览队列,遍历任意数量的消息,然后手动使用该消息。我不确定这种架构的可扩展性到底有多大。
【问题讨论】:
标签: java apache-camel enterprise-integration