Marketplace order ingestion
Trigger. SyncJobScheduler cron * * * * *, order offset 0 within the minute.
Entry. sync_queue job order → SyncJobProcessorWorker → marketplace orderService → MarketplaceOrderIngestionService.
Observed
- Runs in tenant context.
- Inactive tenants or inactive subscriptions are excluded by the scheduler query.
- Unsupported channel types are skipped with a warning.
- The transaction writes the order and enqueues
order.createdwhen there are items and the outbox writer exists. - Address validation is enqueued after that (
validate-pending-order). - Repeated failures suspend the channel. See Channels.
Synchronous versus asynchronous
The sync job is already async relative to any human click. Inside the job, the order commit is synchronous with the outbox insert. Fulfillment still waits for the outbox dispatcher.
Idempotency
Unknown at the channel-order-number unique constraint. SyncJobLog records runs. Do not state that re-sync is safe until the upsert predicate in the ingestion service is read.
Failure
Bull attempts: 3, exponential backoff 5 seconds. Then the circuit breaker can set SUSPENDED. A throw before commit rolls the order back. The next successful attempt can insert it.
Concurrency for the order job is 15.