Event-driven architecture lets services communicate asynchronously: a producer announces a fact about something that happened, and a consumer processes it when ready. A broker buffers the event, so the sender does not need the receiver to be online. The delay between an event being sent and processed is real, so systems must allow for eventual consistency. section 7.9 section 7.1.1
Look for these roles and code patterns:
- Producer: publishes an event and moves on. section 7.9
- Broker: holds messages so consumers can process them later. section 7.9
- Consumer: reacts to an incoming message; its handler can replace a controller action as an entry point. section 7.5.4
- Shared contracts define event payloads, while an IEventPublisher interface keeps domain logic separate from broker implementations. section 7.5.4
An order arrives
The Order Service publishes OrderPlaced. If the Shipping Service is unavailable, the broker can hold the event; when the consumer is ready, it can process the message and print a shipping label. The order service does not have to wait for shipping to come back online. section 7.5.4 section 7.9
Events report what has already happened, rather than telling another service what to do. Name them in the past tense, keep them immutable, and include only the data needed. Acknowledgments and dead-letter queues help handle delivery failures and messages that repeatedly crash consumers; structured logs and correlation IDs help trace activity across services. section 7.9
The tradeoff is not simply performance: asynchronous processing introduces a time gap and eventual consistency. Choose this style when services should remain available independently, and design for delayed processing rather than pretending the gap is gone. section 7.9 section 7.1.1













