Tutorial

18.1 The shape

This is the hub and distributed workers topology, which chapter 11 set up on one machine:

                 ┌──────────────┐
  storefront ───►│     hub      │──── schedules, serves GraphQL and the console, runs no job
  console    ───►│ (one)        │
                 └──────┬───────┘
                        │ jobs in Postgres          run events over RabbitMQ
              ┌─────────┴─────────┐ ◄──────────────────────────────────────┐
              ▼                   ▼                                        │
        ┌──────────┐        ┌──────────┐                                   │
        │ worker 1 │        │ worker 2 │ ── claim jobs, run them ───────────┘
        └──────────┘        └──────────┘
ProcessRegistersMust not
hubAddScheduler with the Postgres submitter, AddTraxGraphQL, the console, the machinesrun jobs itself
workerAddTraxWorker, AddMediator over the same trainsAddScheduler, AddTraxGraphQL

Workers claim jobs from Postgres, each job by exactly one worker, so a third worker is a third container and nothing else.

SDK Reference

Deployment topologies | Move a domain data context to EF migrations | UseRabbitMq | AddTraxHealthCheck | Health and liveness | Startup refusals | UseTraxApiDashboard


Next: 18.2 Migrate the shop's schema