Platform integration boundaries
Scheduling, outbox durability, idempotent notification delivery, and failure boundaries across Platform services.
Purpose & Scope
This document defines the runtime ownership, transactional outbox guarantees, idempotency semantics, and failure boundaries for Scheduler ServiceServicev1.0.0Scheduler ServiceSingle-host Quartz.NET job execution engine and operational dashboard UI for scheduling recurring platform jobs and insp...PublishesProcessVectorBatchIntegrationEventAPIsAsyncAPIOwnerplatform-engineering-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 in the PlatformDomainv1.0.0PlatformProvides cross-cutting capabilities for recurring scheduled triggers and durable, idempotent transactional email notific...Ownerplatform-engineering-teamDiagramOpen docs subdomain. Neither service is exposed through the public API Gateway; use this guide when modifying scheduled jobs, Kafka consumers, or SMTP delivery pipelines.
Visual Reference
The visual below shows how Scheduler ServiceServicev1.0.0Scheduler ServiceSingle-host Quartz.NET job execution engine and operational dashboard UI for scheduling recurring platform jobs and insp...PublishesProcessVectorBatchIntegrationEventAPIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs triggers Catalog IngestionServicev1.0.0Catalog IngestionInternal background worker that reads pending Catalog book updates and synchronizes semantic search vectors in Qdrant. SubscribesProcessVectorBatchIntegrationEventOwnercatalog-experience-teamDiagramRepositoryOpen docs via Kafka and how 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 consumes order commands from 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 to dispatch emails.
Loading graph...
Platform Scheduling, Outbox, and Notification Delivery Boundaries
Core Invariants & Design Rules
- Strict storage isolation: Scheduler ServiceServicev1.0.0Scheduler ServiceSingle-host Quartz.NET job execution engine and operational dashboard UI
for scheduling recurring platform jobs and insp...PublishesProcessVectorBatchIntegrationEventAPIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs reads and writes only Scheduler DatabaseContainerv1.0.0Scheduler DatabaseAuthoritative PostgreSQL database owned by the Platform bounded context for Quartz.NET job definitions, cluster locks, e...Ownerplatform-engineering-teamDiagramOpen docs (Quartz persistent store with 30-day / 100k execution history and Wolverine outbox/inbox). It never queries or mutates Catalog, Ordering, or Qdrant stores. 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 is a stateless worker with no SQL database, using Redis solely for FusionCache and
24hintegration-event idempotency. - Trigger completion vs. downstream completion: A completed vector-batch job proves only that Process vector batchEventv1.0.0Process vector batchIntegration event published by Scheduler every five minutes to trigger Catalog Ingestion vector batch processing over Ka...Ownerplatform-engineering-teamSchemaDiagramOpen docs was durably enqueued via the PostgreSQL outbox to Process Vector Batch ChannelChannelv1.0.0Process Vector Batch ChannelUnprefixed Kafka trigger topic owned by the platform team used by Scheduler Service every five minutes to initiate Catal...Ownerai-capabilities-teamOpen docs—never that Catalog IngestionServicev1.0.0Catalog IngestionInternal background worker that reads pending Catalog book updates and synchronizes semantic search vectors in Qdrant. SubscribesProcessVectorBatchIntegrationEventOwnercatalog-experience-teamDiagramRepositoryOpen docs finished updating Catalog VectorContainerv1.0.0Catalog VectorNon-authoritative Qdrant vector search index owned by the Catalog bounded context for hybrid semantic and keyword book d...Ownercatalog-experience-teamDiagramOpen docs.
- SMTP handoff vs. business status: 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 renders email templates and hands payloads to SendGrid APIServicev1.0.0SendGrid APIExternal SMTP email delivery provider used by BookWorm to submit rendered
order notification emails over authenticated S...Ownerplatform-engineering-teamDiagramOpen docs (or Mailpit in development) over SMTP port
587. SMTP acceptance proves only relay handoff, never inbox delivery or authoritative order status. - Blank recipient safety: Commands with null, empty, or whitespace recipient email addresses are skipped cleanly without throwing or poisoning the consumer queue.
- Confidentiality in telemetry: Customer email addresses and rendered HTML bodies must never appear in logs or traces; emit only order IDs, message IDs, counts, timestamps, and sanitized exception types.
Preserve unprefixed topic routing for scheduler.process-vector-batch. Catalog IngestionServicev1.0.0Catalog IngestionInternal background worker that reads pending Catalog book updates and
synchronizes semantic search vectors in Qdrant.
SubscribesProcessVectorBatchIntegrationEventOwnercatalog-experience-teamDiagramRepositoryOpen docs binds its Kafka trigger directly to the unprefixed topic name Process Vector Batch ChannelChannelv1.0.0Process Vector Batch ChannelUnprefixed Kafka trigger topic owned by the platform team used by Scheduler
Service every five minutes to initiate Catal...Ownerai-capabilities-teamOpen docs. Adding an environment prefix or renaming the topic breaks scheduled vector indexing silently.
Boundaries & Guarantees
| Concern | Strategy & Guarantee | Failure / Edge-Case Behavior | Related Resources |
|---|---|---|---|
| Persistence | scheduler-service persists Quartz triggers and Wolverine outbox/inbox in scheduler-database; notification-api persists no domain state. | scheduler-service outbox guarantees at-least-once publication after job commit; notification-api relies on Kafka offsets and Redis idempotency. | scheduler-database, adr-001-postgresql-quartz-persistence, adr-002-notification-postgresql-email-outbox |
| Caching & Idempotency | notification-api wraps PlaceOrderCommand, CompleteOrderCommand, and CancelOrderCommand handlers in a 24h Redis integration-event idempotency guard keyed by message.Id and handler name. | Duplicate Kafka deliveries of the same message.Id are skipped; distinct retried commands from order-orchestration carry new message IDs and are processed independently. | PlaceOrderCommand, CompleteOrderCommand, CancelOrderCommand, adr-001-notification-kafka-command-intake |
| Messaging & Resilience | notification-api applies a Polly resilience pipeline (CircuitBreaker, exponential Retry with jitter, 30s Timeout) around SMTP submission, plus Wolverine retries (50ms / 250ms / 1s with full jitter). | Messages exhausting both Polly and Wolverine retries route to <code>bookworm.{env}.notification.dead-letter-queue</code> for inspection and replay. | <code>bookworm.{env}.finance.place-order</code>, <code>bookworm.{env}.finance.complete-order</code>, <code>bookworm.{env}.finance.cancel-order</code>, <code>bookworm.{env}.notification.dead-letter-queue</code> |
| Concurrency & Misfires | Vector-batch jobs enforce [DisallowConcurrentExecution] and UTC FireOnceNow misfire handling; Dashboard Agent restricts remote execution to registered Platform job types. | Missed intervals coalesce into a single catch-up run rather than replaying every missed tick; overlapping executions are blocked at the Quartz lock level. | scheduler-service, ProcessVectorBatchIntegrationEvent, adr-002-scheduler-invocation-boundary, adr-003-idempotent-misfire-aware-jobs |
Safe Change & Verification Checklist
- Keep authoritative business state in its owning bounded context; never treat SMTP handoff or Notification telemetry as order status.
- Preserve unprefixed topic routing on Process Vector Batch ChannelChannelv1.0.0Process Vector Batch ChannelUnprefixed Kafka trigger topic owned by the platform team used by Scheduler
Service every five minutes to initiate Catal...Ownerai-capabilities-teamOpen docs and
OrderIdpartitioning on Finance notification commands. - Keep SMTP credentials, HMAC keys, and connection strings in runtime secrets/parameters—never in source control or job definitions.
- Ensure customer email addresses and rendered email bodies remain redacted from logs and error payloads.
- Run
mise run format,mise run build, andmise run testto verify Platform unit tests and Pact contracts (Notification-Finance,Catalog-Scheduler).
Related Resources
- Scheduler ServiceServicev1.0.0Scheduler ServiceSingle-host Quartz.NET job execution engine and operational dashboard UI for scheduling recurring platform jobs and insp...PublishesProcessVectorBatchIntegrationEventAPIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs — Quartz.NET scheduler and outbox producer
- 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 — Stateless Kafka-to-SMTP notification worker
- SendGrid APIServicev1.0.0SendGrid APIExternal SMTP email delivery provider used by BookWorm to submit rendered order notification emails over authenticated S...Ownerplatform-engineering-teamDiagramOpen docs — External SMTP relay provider
- Notification DeliveryFlowv1.0.0Notification DeliveryFinance emits order-notification commands over Kafka; Notification API applies Redis idempotency, renders MJML email tem...Ownerplatform-engineering-teamView flowOpen docs, Product IngestionFlowv1.0.0Product IngestionCatalog API persists product changes in PostgreSQL; Scheduler triggers Catalog Ingestion over Kafka every five minutes t...Ownercatalog-experience-teamView flowOpen docs — End-to-end delivery and ingestion workflows
- ADR-001: Persist Quartz scheduling state in PostgreSQLDecision Recordv1.0.0ADR-001: Persist Quartz scheduling state in PostgreSQLThe Scheduler System uses PostgreSQL as the authoritative durable store for Quartz schedules, trigger state, coordinatio...Ownerplatform-engineering-teamOpen docs, adr-003-idempotent-misfire-aware-jobs, adr-003-notification-smtp-provider-boundary, adr-005-notification-confidential-data-boundary
- API and contracts indexCustom DocAPI and contracts indexConsolidated index of BookWorm HTTP v1, gRPC, AG-UI, MCP, A2A, and Kafka/Wolverine contracts grouped by service with aut...Ownerplatform-engineering-teamOpen doc — Consolidated HTTP, gRPC, and Kafka contracts