Scheduled work and email notifications
A practical guide to Platform schedules, target-system ownership, and the durable email workflow.
Audience & Outcome: This guide is for platform engineers and operators working with 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. You will learn how recurring jobs trigger catalog indexing and how stateless transactional email delivery guarantees reliability without a notification database.
BookWorm’s Platform subdomain separates recurring time-based orchestration from transactional email dispatch into two independent services: 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 runs recurring Quartz.NET jobs backed by 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, while 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 operates as a stateless Kafka and SMTP worker with no database.
Context and motivation
Two distinct operational needs exist across BookWorm’s business domains:
- Periodic batch triggers: Catalog books change continuously, and generating embeddings plus 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 is more efficient in scheduled batches than inside synchronous HTTP book writes.
- Decoupled customer emails: Order creation, completion, and cancellation should never block on external SMTP server latency or fail when an email provider is temporarily unreachable.
Separating these capabilities into dedicated Platform services keeps domain services focused on business invariants while avoiding cross-domain database coupling.
How it works
The visual below illustrates the two independent Platform pipelines—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 triggering Catalog IngestionServicev1.0.0Catalog IngestionInternal background worker that reads pending Catalog book updates and synchronizes semantic search vectors in Qdrant. SubscribesProcessVectorBatchIntegrationEventOwnercatalog-experience-teamDiagramRepositoryOpen docs on a UTC cadence, 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 delivering order emails over SMTP.
Loading graph...
Recurring work in Scheduler
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 persists Quartz state, 30-day execution history, and its transactional outbox in 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 Dashboard (exposed at /quartz behind Microsoft Entra ID admin role) provides operational visibility.
| Job | Cron (UTC) | Cadence | Behavior |
|---|---|---|---|
ProcessVectorBatchJob | 0 0/5 * * * ? | Every 5 minutes | Non-concurrent; publishes 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 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 |
HeartbeatJob | 0/30 * * * * ? | Every 30 seconds | Emits structured heartbeat logs and OpenTelemetry telemetry |
Both jobs use FireOnceNow misfire handling so a missed run triggers one immediate catch-up execution rather than replaying every missed interval. When ProcessVectorBatchJob succeeds, 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 guarantees only that the Kafka event was published. Catalog IngestionServicev1.0.0Catalog IngestionInternal background worker that reads pending Catalog book updates and
synchronizes semantic search vectors in Qdrant.
SubscribesProcessVectorBatchIntegrationEventOwnercatalog-experience-teamDiagramRepositoryOpen docs independently consumes 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 to update 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.
Stateless email delivery in Notification
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 Finance’s Kafka order commands (<code>bookworm.{env}.finance.place-order</code>, <code>bookworm.{env}.finance.complete-order</code>, and <code>bookworm.{env}.finance.cancel-order</code>), partitioned by OrderId:
Idempotency and blank-email check
Each handler checks a 24-hour Redis idempotency guard keyed by message ID and handler name, skipping duplicate deliveries. Messages with blank or whitespace recipient emails return cleanly without error.
Template rendering and resilient SMTP handoff
The worker renders the MJML order email template into HTML and delivers it over SMTP (Mailpit locally, 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 in Azure) through a resilience pipeline with circuit breaking, exponential retry with jitter, and a 30-second timeout.
Dead-letter queue fallback
If transient SMTP failures exhaust both resilience and broker retries, failed messages route to <code>bookworm.{env}.notification.dead-letter-queue</code> for operator investigation and replay.
NoteSMTP acceptance proves only that the relay server accepted the message; it never proves inbox delivery or commercial order status.
| Decision | Benefits | Costs and limits |
|---|---|---|
| Stateless Notification worker (Kafka + Redis + DLQ) | Removes a database, migrations, and hourly resend jobs; uses native Kafka durability | Replaying failed emails requires Kafka DLQ tooling rather than SQL queries |
| At-least-once Kafka delivery with message ID deduplication | Prevents lost order emails during transient network or SMTP outages | Ambiguous SMTP timeouts or reissued commands can still produce duplicate emails |
| Kafka event trigger from Scheduler to Catalog Ingestion | Eliminates synchronous HTTP coupling and token management between Scheduler and Catalog | Operators must inspect both Scheduler history and Catalog DatabaseContainerv1.0.0Catalog DatabaseAuthoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publisher...Ownercatalog-experience-teamDiagramOpen docs to confirm indexing |
FireOnceNow misfire instruction | Prevents catch-up storms after Scheduler downtime | Intermediate missed windows are skipped |
Rejected alternatives:
- PostgreSQL email outbox with hourly Quartz resend jobs: Retired because maintaining a dedicated database and sweeping jobs duplicated Kafka’s native durable log, retry, and dead-letter queue capabilities.
- Direct HTTP calls from Scheduler to Catalog: Coupled ingestion availability directly to Scheduler execution.
Related documentation
- 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 — End-to-end notification delivery flow.
- 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 scheduled vector ingestion flow.
- 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 — Detailed Scheduler service reference.
- 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 — Detailed Notification service reference.