I'm having trouble getting a client/server implementation of Quartz.NET working.
I have a SQL Server on ServerA, a server running Quartz as a service (ServerB) and a server which hosts an ASP.NET application (ServerC).
I have followed all the tutorials and delved into the code a fair amount but I can't see what I'm doing wrong. The server is definitely listening and I can see the port is open from ServerC. No firewalls involved.
ServerB, which is running the service included in the download package (Quartz.Server.Service) has the following config file settings:
<quartz>
<add key="quartz.server.serviceName" value="quartz" />
<add key="quartz.server.serviceDisplayName" value="Job Scheduler" />
<add key="quartz.scheduler.instanceName" value="RemoteServer" />
<add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
<add key="quartz.threadPool.threadCount" value="10" />
<add key="quartz.threadPool.threadPriority" value="Normal" />
<add key="quartz.scheduler.exporter.type" value="Quartz.Simpl.RemotingSchedulerExporter, Quartz" />
<add key="quartz.scheduler.exporter.port" value="5656" />
<add key="quartz.scheduler.exporter.bindName" value="QuartzScheduler" />
<add key="quartz.scheduler.exporter.channelType" value="tcp" />
<add key="quartz.jobStore.type" value="Quartz.Impl.AdoJobStore.JobStoreTX, Quartz" />
<add key="quartz.jobStore.driverDelegateType" value="Quartz.Impl.AdoJobStore.SqlServerDelegate, Quartz" />
<add key="quartz.jobStore.tablePrefix" value="qrtz_" />
<add key="quartz.jobStore.dataSource" value="db" />
<add key="quartz.dataSource.db.provider" value="SqlServer-20" />
<add key="quartz.dataSource.db.connectionString" value="Data Source=ServerA;Initial Catalog=dev;User ID=dev;Password=dev" />
<add key="quartz.jobStore.useProperties" value="true" />
<add key="quartz.jobStore.lockHandler.type" value="Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz" />
</quartz>
The ASP.NET app has the following config:
<quartz>
<add key="quartz.scheduler.instanceName" value="RemoteClient" />
<add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
<add key="quartz.threadPool.threadCount" value="5" />
<add key="quartz.threadPool.threadPriority" value="Normal" />
<add key="quartz.scheduler.proxy" value="true" />
<add key="quartz.scheduler.proxy.address" value="tcp://ServerB:5656/QuartzScheduler" />
</quartz>
I have tried numerous things. Occasionally I get an error that the scheduler already exists instead of the one in the question title.
I have read elsewhere that due to threading issues I should create the scheduler in a singleton, which I have done:
private static readonly ISchedulerFactory _schedulerFactory;
private static readonly IScheduler _scheduler;
static JobScheduleService() {
_schedulerFactory = new StdSchedulerFactory();
_scheduler = _schedulerFactory.GetScheduler();
}
public static IScheduler GetScheduler() {
return _scheduler;
}
What have I missed? TIA
If I open up a telnet box on the web server and connect to the quartz server then the service is definitely responding. If I type a few characters I get an error from Quartz.
Does this help? I.e. it's not a connectivity issue?
Try NOT setting any of the quartz.threadpool.xxxxxx properties.
It turns out that the error message is just a bit misleading. The error wasn't in the communication with the server at all. The problem was a missing DLL file that wasn't being copied as part of the deployment. The underlying error was due to the schedulers inability to find the DLL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With