CURRICULUM PREVIEWRevision 1 · Open for reviewReview the full course
CONNECTING THE PIECES10 min read

Event-driven integration

Communicate facts without hiding ownership.

Before you beginmicroservices

The problem and the pattern

BookingReserved is a fact about a committed reservation. Consumers decide what that fact means inside their own context. A queue decouples availability but creates delivery, ordering, and schema-evolution responsibilities. State who publishes, who consumes, and how failures are retried or quarantined.

Follow the flow

Make it concrete

This excerpt isolates the concept. Connect it to the booking API as you work through the exercise.

Focused example
C#
public sealed record BookingReserved(
    Guid EventId, Guid BookingId, string TenantId,
    DateTimeOffset OccurredAt);

Trade-offs

  • Asynchronous integration reduces temporal coupling.
  • Schemas and delivery guarantees become part of the contract.
  • Carry minimal necessary data and avoid secrets in durable events.

When to avoid it

Avoid events for a request that needs an immediate authoritative answer from the owning service.

Your turn

A consumer receives the same event twice and an older event after a newer one. What assumptions should it avoid?

Reveal a worked answer

Do not assume exactly-once or global order. Deduplicate by event identity where needed, use an aggregate version if ordering matters, and define replay behavior. Monitor poison messages rather than retrying forever.

Keep exploring

One more piece connected.

Mark this lesson complete when you can explain the idea.