# Trace an Order Saga Through Orbit's .NET 11 Modular Monolith

> Follow a contested order from synchronous SKU snapshotting through atomic PostgreSQL Outbox persistence, O(1) System.Threading.Channels topic routing, FOR UPDATE stock locking, idempotent Inbox deduplication, and OpenTelemetry trace propagation.

Canonical: https://modularmonolith.com/tour/

## Six-Step Saga & Telemetry Walkthrough

1. **Snapshot SKU & Pricing via `ICatalogPublicApi` (`Orders -> Catalog`)**: `PlaceOrderCommandHandler` validates active SKUs synchronously in-process before opening `Orders`'s local write transaction.
2. **Commit Order & Outbox Message Atomically (`orders` schema)**: `InsertOutboxMessagesInterceptor` captures domain events and the active W3C `Activity.Current.Id` (`trace_parent`) into `orders.outbox_messages` in the same commit, then pulses `OutboxWakeupSignal`.
3. **Route `orders.order-placed` via `TopicSubscriptionRegistry` (`Orbit.Common.EventBus`)**: `ChannelEventBus` resolves subscribed `SubscriptionChannel` queues in O(1) from a `FrozenDictionary` without broadcast fan-out or head-of-line blocking.
4. **Lock Contended Stock with `FOR UPDATE` (`inventory` schema)**: `Inventory` records an idempotent receipt in `inventory.inbox_message_consumers`, acquires `SELECT *, xmin FROM inventory.stock_items ... ORDER BY product_id FOR UPDATE`, and commits either `OrderStockReserved` or `OrderStockRejected`.
5. **Confirm Order & Provision Fulfillment (`orders` + `shipments` schemas)**: `inventory.order-stock-reserved` fans out to two independent bounded subscriber channels—confirming the order in `Orders` and opening a `Pending` pick-list in `Shipments`.
6. **Verify Boundaries & Inspect Distributed Traces**: 49 automated architecture & schema tests enforce compile-time and SQL isolation while Aspire Dashboard visualizes the entire multi-module trace.
