The publish-subscribe pattern: garbage-collecting old subscriptions

I’ve been studying distributed systems design, in particular the Udi Dahan’s class. He talks about the publish-subscribe pattern as a common pattern in messaging-oriented designs. There’s obviously a clear point in time when subscriptions to a publisher happen. However—and I might be missing something—he spent no time discussing unsubscribes.

So my question is—given a distributed system with components that evolve over time, how do popular implementations of this pattern deal with stale subscriptions? I understand that in a optimal situation, there are points in time when the subscriber explicitly declares that it is no longer interested in messages from a given source (maybe on clean shutdown, maybe on some kind of decommissioning of the component)… but given faulty networks, software and hardware, I can imagine the case where the publisher keeps thinking the subscriber still waits for its messages despite not existing for years, and no-longer-necessary messages clogging the messaging system.

Go to Source
Author: liori