Communication · Intermediate · 9 min

Pub/Sub & Events

Distinguish broadcasting an event from assigning one job to a competing worker.

STEP 1 / 10
Call every dependent service directly — isometric concept diagramDecide which effects must finish before the response. Components: 1. Order service. Logical component or processing boundary; 2. Email subscriber. Logical component or processing boundary. Connections: 1. Order service to Email subscriber: Call every dependent service directly; 2. Email subscriber to Order service: Reply: Email subscriber. Illustrations are conceptual, not deployed capacity or user counts.Order service → Email subscriber: Call every dependent service directly1Email subscriber → Order service: Reply: Email subscriber2Order service: Logical component or processing boundary1Order serviceLogical component or processingboundaryEmail subscriber: Logical component or processing boundary2Email subscriberLogical component or processingboundary
1Order service2Email subscriber
  1. 1Order service → Email subscriberRequestCall every dependent service directly
  2. 2Email subscriber → Order serviceReplyReply: Email subscriber

Conceptual illustration · figures do not imply user counts, deployed capacity or replica counts.

2 components visible · Order service + Email subscriber highlighted

Orange: request / query · Blue: reply · Purple: event / control · Arrows show direction; speed is illustrative.

You’ll learn

  • Independent consumers need independent delivery state.
  • An event needs identity, meaning and an evolution policy.
  • Replay safety belongs to each effect boundary.

PUT THE IDEA TO WORK

From learning to practice

RELATED PATTERNS

Publish–Subscribe ↗

Event-Driven architecture ↗

Further reading

Microsoft · Publisher-subscriber ↗