我正在使用Apache Camel與ActiveMQ並希望實現有保證的消息傳遞。在駱駝保證交付
我一直在閱讀駱駝在行動書以及Apache的駱駝開發人員的食譜。
我希望這裏有人可以在我的方法中給我建議。我不是要求代碼示例。
我所設想的實現方式如下:
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
聽起來很容易。然而,我一直在閱讀駱駝的「死信頻道」模式。
我的理解就是採用這種模式的實現意味着,而非自動丟棄每個(保證)消息,我的「GuaranteedMessages」隊列,我放棄這種做法,而是,我設置的再分發選項(最大努力,指數延遲,重新傳遞延遲等)。然後,我依靠駱駝嘗試重新傳送,如果它從未經過,就直接將它放在死信通道延遲中。
然後,我會有一個單獨的路由使用這個死信隊列作爲它的源。再次,它將是相同的模式。如果不能成功,則將消息發送回死信隊列。
這聽起來像一個生產系統的現實實施?
如果相反,我決定在我自己的「GuaranteeMessage」隊列中放棄每個傳入的消息(需要保證),相信我稍後可以從隊列中手動刪除該特定消息是否現實?我的理解是,我將不得不手動瀏覽隊列,迭代任意數量的消息,然後手動使用該消息。我不確定這種架構的可擴展性如何。