I am able to queue MassTransit jobs with Quartz.Net, but I can't figure out how to set up MassTransitJobFactory to process them with my producer. Currently the messages that are taken out of the database are all ending up in my producer's error queue---but without any error message that I can find.
Here's generally how I set this up:
NameValueCollection properties = new NameValueCollection();
properties["quartz.scheduler.instanceName"] = MASSTRANSIT_QUARTZ;
properties["quartz.scheduler.instanceId"] = "AUTO";
properties["quartz.jobStore.type"] = "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz";
properties["quartz.jobStore.dataSource"] = "default";
properties["quartz.jobStore.tablePrefix"] = "QRTZ_";
properties["quartz.jobStore.lockHandler.type"] = "Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz";
properties["quartz.dataSource.default.connectionString"] = _myConnectionString
properties["quartz.dataSource.default.provider"] = "SqlServer-20";
ISchedulerFactory schedulerFactory = new StdSchedulerFactory(properties);
var scheduler = schedulerFactory.GetScheduler();
var bus = _busCreator.CreateBus(MASSTRANSIT_QUARTZ+"-Trolley");
scheduler.JobFactory = new MassTransitJobFactory(bus);
scheduler.Start();
// ...
Is there anything else I need to do to get this to work? It looks to me like the purpose of the MassTransitJobFactory is to take any message that comes from Quartz and place it back on the bus for reprocessing....
And will I be able to use one MassTransitJobFactory to reprocess all my various queued messages, or do I need several (and therefore several Quartz schedulers)?
Thanks,
-Mike