分布式主题实现、消息生命周期
我有一个分布式系统,其中节点通过广播或带有队列的 p2p 消息进行通信。 如果消息是广播,它会转到消息主题,并且节点会不时查看它。 不可能知道当前活动节点的数量,以及节点何时查看该主题的确切时间,但所有节点都获取该信息至关重要。
如何最大限度地缩短消息生命周期,同时确保所有节点都得到通知?
或者这是不可能的,重要消息应该进入 p2p 队列?
I have a distibuted system where nodes communicate with messages, either broadcast or p2p with queues.
If the message is a broadcast it goes to a message topic and of the nodes peek it from time to time.
It is not possible to know the current number of living nodes, and exactly when the nodes will look at the topic, but it is vital that all nodes get the information.
How can I minimize the message lifetime while ensuring that all nodes got informed?
Or this is impossible and vital messages should go to the p2p queue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这对我来说听起来几乎是不可能的。正如您所指定的,最短生命周期是“永远”,因为您永远不知道某个节点会在多久后决定查看某些特定的信息。
这给您留下了两个选择:要么设置超时并在过期时销毁数据,要么保留想要了解特定事件的节点列表,并(尝试)在相关信息可用时通知它们。
It sounds like pretty much an impossibility to me. As you've specified it, the minimum lifetime is "forever", because you never know how much later some node may decide to peek for some particular piece of information.
That leaves you two choices: either set a timeout and destroy the data when it expires, or else keep a list of the nodes that want to be informed about particular events and (attempt to) notify them when relevant information becomes available.