消息队列:消息是否会因网络故障而丢失?

发布于 2024-07-26 20:17:59 字数 310 浏览 2 评论 0原文

我想知道 WebsphereMQ 或 ActiveMQ(通过 JMS 使用)等消息传递系统中消息传递的可靠性。 据我所知,如果收件人不可用,消息可以被缓冲,并稍后发送。

现在我想知道如果发件人暂时无法访问网络会发生什么。 是否有某种本地缓冲稍后会发送消息? 我认为这取决于消息代理的运行位置。 所有机器上都有本地经纪人还是只有中央一台机器上有本地经纪人?

明确我的问题:如果我需要确保最终收到消息,即使面对临时网络故障,消息传递系统是否是正确的选择? 是否需要一定的设置才能实现这种可靠性?

任何指向相关文档的指针将不胜感激。

I am wondering about the reliabilty of message delivery in messaging systems such as WebsphereMQ or ActiveMQ (used via JMS). As far as I know messages can be buffered if the recepient is unavailable and will be delivered later.

Now I am wondering what happens if the sender temporarily cannot reach the network. Is there some kind of local buffering which will send the messages later? I assume this depends on where the message broker is running. Are there local brokers on all machines or just a central one?

To pinpoint my question: Is a messaging system the right choice if I need to ensure, that messages are received eventually, even in the face of temporary network failure? Is there a certain setup required to achieve this reliabilty?

Any pointers to relevant documentation would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

七堇年 2024-08-02 20:17:59

常见的解决方案称为“存储并转发”。 在此类系统中,一旦您将消息交给本地消息代理,他们就负责。 该代理人可能不是正式经纪人。 如果消息传递系统具有基本的传递保证,则本地代理仍然需要持久缓冲消息,直到它们被移交给真正的代理。

The common solution is called "store and forward". In such systems, once you've handed off the message to the local message agent it becomes their responsibility. This agent might not be a full broker. If the messaging system has basic delivery guarantees, the local agent will still need persistent buffering of messages until they're handed off to a real broker.

扛起拖把扫天下 2024-08-02 20:17:59

如果您确实无法承受丢失消息的损失,我建议您在端点上实现可靠的消息传递模式(如果可以的话),即如果在特定时间段内未收到确认并且接收方有重复检测来应对,则发送方会重新发送多次收到相同的消息。

有保证的传递会带来性能开销,并且通常不能保证消息到达目的地可能需要多长时间。

If you really can't afford to lose messages I'd recommend implementing a reliable messaging pattern at the endpoints if you can, i.e. the sender re-sends if no acknowledgement is received within a certain time period and the receiver has duplicate detection to cope with receiving the same message more than once.

Guaranteed delivery comes with a performance overhead and usually doesn't give any guarantee as to how long your message might take to get there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文