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?
I have a distibuted system where nodes communicate with messages, either broadcast or p2p
Share
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.