Skip to content

Scheduler Composition

At this section, some infrastructure details of the Infrastructure Scheduler such as its composition in the Event Broker and its database connection will be covered.

Queues/Exchanges

When the scheduler has initialized successfully, it will create five exchanges in the event broker, those are:

  • quartz.
  • MassTransit.Scheduling:CancelScheduledMessage.
  • MassTransit.Scheduling:ScheduleMessage.
  • MassTransit.Scheduling:CancelScheduledRecurringMessage.
  • MassTransit.Scheduling:ScheduleRecurringMessage.

At the same time, a queue called quartz is created. This name is defined by default and can not be changed. It could be accessed through the MassTransitConstants class defined at the MassTransitModule.

Additionally, a BusObserver for the quartz queue will be created.

Here is a diagram of the bindings of both exchanges and queue.

Scheduler bindings at the event broker

Database Connection

The scheduler currently runs over Quartz.NET and uses its tables to store and retrieve schedules. Currently three database engines are supported:

  • MS SqlServer.
  • Oracle 11 (has its own provider).
  • Oracle (Higher than 11).
  • SQLite.

To configure the connection properly, at the appsettings.json file of the Scheduler's application layer, the connection string has to be configured properly for the desired engine and also the DefaultDatabaseProviderKey from the EntityFrameworkCoreModuleOptions has to configured for it:

JSON
1
2
3
    "EntityFrameworkCoreModuleOptions": {
        "DefaultDatabaseProviderKey": "SqlServer"
    },

The possible key values could be found here.