ADR-BW-010: Preserve message identity and cross-boundary correlation
Carry stable integration identity and request context for routing and diagnosis without using correlation fields as authorization credentials.
| Field | Value |
|---|---|
| Status | Proposed |
| Date | 2026-11-07 |
| Owners | Platform Engineering TeamTeamPlatform Engineering TeamPlatform team providing BookWorm's thinnest viable platform—orchestration, messaging fabric, scheduling, notifications, ...Open docs |
| Affected Resources | BookWormDomainv1.0.0BookWormCore e-commerce domain for the BookWorm online bookstore, coordinating catalog discovery, customer baskets, order fulfil...Ownerarchitecture-enabling-teamDiagramRepositoryOpen docs |
| Related ADRs | ADR-BW-005: Use Kafka for configured asynchronous integrationDecision Recordv1.0.0ADR-BW-005: Use Kafka for configured asynchronous integrationRetain the shared Wolverine Kafka integration for asynchronous cross-capability messages where a broker is configured.Ownerplatform-engineering-teamOpen docs, ADR-BW-013: Use shared structured logging and OpenTelemetryDecision Recordv1.0.0ADR-BW-013: Use shared structured logging and OpenTelemetryProduce correlated logs, traces, metrics, and configured health signals while keeping business completion separate from ...Ownerplatform-engineering-teamOpen docs, ADR-003: Integrate through Kafka contracts correlated by Order IDDecision Recordv1.0.0ADR-003: Integrate through Kafka contracts correlated by Order IDFinance exchanges environment-scoped integration messages through Kafka and partitions messages exposing OrderId by that...Ownercommerce-fulfillment-teamOpen docs |
Context & Problem Statement
Customer journeys such as checkout and review projection span microfrontends, HTTP/gRPC boundaries, Kafka topics, and background workers. Without stable correlation and message identifiers, operators cannot trace failures end to end, yet correlation headers must never be trusted as authentication or authorization proof.
Decision Drivers
- End-to-end traceability: Connect spans and logs across HTTP, gRPC, and Kafka hops.
- PII-safe diagnostics: Correlate journeys via opaque IDs without logging personal data.
- Security isolation: Keep correlation metadata strictly separate from Entra ID auth claims.
Options Considered
| Option | Pros | Cons |
|---|---|---|
| Propagate trace/message IDs + enforce auth independently | Unified tracing across sync and async paths; zero privilege escalation | Every hop must preserve correlation headers/envelopes |
| Generate isolated IDs per service | Zero upstream propagation required | Breaks end-to-end failure correlation |
| Correlate by timestamp or customer email | No extra headers needed | Unreliable under load and leaks PII into logs |
| Trust correlation/user IDs as auth credentials | Fewer token checks downstream | Vulnerable to header spoofing and privilege escalation |
Decision & Consequences
Chosen Option: Propagate W3C trace context, request IDs, and stable CloudEvents message identities across all synchronous and asynchronous hops while verifying authentication and authorization independently at each boundary.
- Positive: Operators can trace a single request across Order APIServicev1.0.0Order APIAuthenticated Ordering service for Buyer profiles and the Order lifecycle, creating Orders from baskets, snapshotting pr...PublishesGetBasketGrpc, GetBookGrpc +5SubscribesCreateOrder, CompleteOrder +11APIsOpenAPI, AsyncAPI, Carrier Service LevelsOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs, Order OrchestrationServicev1.0.0Order OrchestrationMessage-driven Finance workflow service that coordinates post-checkout basket cleanup and order notifications using Dura...PublishesPlaceOrderCommand, DeleteBasketCompleteCommand +3SubscribesUserCheckedOutIntegrationEvent, OrderStatusChangedToCompleteIntegrationEvent +3APIsAsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs, Basket APIServicev1.0.0Basket APIInternal HTTP and gRPC service for managing customer-scoped shopping baskets, Catalog price enrichment, and post-checkou...PublishesGetBookGrpc, GetBooksGrpc +2SubscribesCreateBasket, UpdateBasket +4APIsOpenAPI, AsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs, and Notification APIServicev1.0.0Notification APIInternal background worker that consumes order commands from Kafka, renders MJML email templates, and submits mail over ...SubscribesPlaceOrderCommand, CancelOrderCommand +1APIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs without exposing PII.
- Negative: Changing event names or omitting envelope propagation breaks trace continuity.
Compliance Criteria
- Integration events must carry stable message IDs and domain correlation keys (e.g.,
OrderId,FeedbackId). - Handlers and endpoints must derive caller identity exclusively from validated Entra ID tokens—never from correlation headers or payload fields.
- Incident logs and traces must correlate via opaque IDs rather than customer emails or names.