Search code examples
schedulingquartz.netmasstransitquartz

MassTransit and Quartz.net - How to populate lots of scheduled jobs


I have been looking at using MassTransit's Quartz.Net (using AdoJobStore) implementation to schedule messages send/publish for future and all of this works fairly smoothly.

The bit where I am stuck is, as a part of the production deployment, I need to set up a lot of "Scheduled Messages" to be issued at various times during the next year odd.

Is there a mechanism available to pre-populate the Quartz SQL store with Triggers/Jobs externally ?


Solution

  • I finally figured a way to do this; posting here, so it might help others if needed.

    The Quartz SQL DB is nothing but a simple data serialised into objects. e.g. varbinary for JOB_DATA and ticks in for time. Other values are fairly simple.

    I ended up created a sample app to setup some schedules and then reversed the database later to figure.

    It was all quite simple in the end, and now I have splain SQL insert script which inserts the schedules as a part of the CD pipeline.