如何在Java和C#中获得相同的石英调度程序实例?

时间:2017-09-07 07:16:09

标签: java c# quartz-scheduler

我的石英调度程序已由java程序启动(作为Windows服务)。现在我需要通过c#客户端获取相同的调度程序实例。我总是得到一个新的调度程序实例,而不是java创建/启动的实例。

C#代码中的Quartz属性:

NameValueCollection properties = new NameValueCollection();
properties["quartz.scheduler.instanceName"] = "TestSyncScheduler";
properties["quartz.scheduler.instanceId"] = "TestSyncId";

// set thread pool info
properties["quartz.threadPool.type"] = "Quartz.Simpl.SimpleThreadPool, Quartz";
properties["quartz.threadPool.threadCount"] = "10";
properties["quartz.threadPool.threadPriority"] = "Normal";

properties["quartz.scheduler.exporter.type"] = "Quartz.Simpl.RemotingSchedulerExporter";
properties["quartz.scheduler.exporter.bindName"] = "SyncScheduler";
properties["quartz.scheduler.exporter.channelType"] = "tcp";
properties["quartz.scheduler.proxy.address"] = "tcp://127.0.0.1:1100";
properties["quartz.jobStore.type"] = "Quartz.Simpl.RAMJobStore, Quartz";
properties["quartz.jobStore.misfireThreshold"] = "60000";

Java代码中的Quartz属性:

org.quartz.scheduler.instanceName: TestSyncScheduler
org.quartz.scheduler.instanceId: TestSyncId
org.quartz.scheduler.rmi.export: true
org.quartz.scheduler.rmi.createRegistry = true
org.quartz.scheduler.rmi.registryHost = 127.0.0.1
org.quartz.scheduler.rmi.registryPort = 1200
org.quartz.scheduler.rmi.serverPort = 1100
org.quartz.scheduler.wrapJobExecutionInUserTransaction: false
org.quartz.scheduler.jmx.export=false
org.quartz.scheduler.jmx.objectName=quartz:type=QuartzScheduler,name=SyncScheduler
org.quartz.threadPool.class: org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount: 10
org.quartz.threadPool.threadPriority: 5
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread: true
org.quartz.jobStore.misfireThreshold: 60000
org.quartz.jobStore.class: org.quartz.simpl.RAMJobStore

问题:如何在Java和C#中使用给定属性获得相同的石英调度程序实例?

0 个答案:

没有答案