The Observer pattern is a messaging pattern: an Observer subscribes to a Subject . When the later emits an event, the former is notified. This is Point-to-Point messaging: if multiple observers are interested in an event, they all must subscribe to the subject.

Point-to-point messaging comes with with a huge downside: each observer needs to reference each relevant subject at one point or another. This exponentially increases the complexity when the number of observer-subject pairs grows.

Another way to do messaging is Publish-Subscribe. In that case, messages are sent to a queue. Subscribers can register to a specific queue, to be notified of messages sent to that queue. As an option, messages can be persisted, so that subscribers registering to a queue can be notified of messages sent prior to the registration.

The Event Bus is an implementation of the Publish-Subscribe pattern, where there’s a single dedicated queue for each event type. Here’s the class diagram: