Publishing to an event hub
The ability to publish events is a fundamental capability of autonomous services. Upstream services publish events as their state changes and downstream services react to these events. This publish and subscribe paradigm decouples producers from consumers, but if we are not careful, we can inadvertently introduce coupling and complexity through the messaging infrastructure.
In Chapter 2, Defining Boundaries and Letting Go, we discussed the importance of creating an architecture of autonomous subsystems. Each subsystem is composed of a highly cohesive set of autonomous services. We have seen Figure 4.1 before. It depicts how we can compose an event-first topology out of autonomous subsystems. This natural fractal pattern produces a system that is very easy to comprehend and reason about. We will see how to connect subsystems in Chapter 7, Bridging Intersystem Gaps:
At the heart of each autonomous...