1
我試圖遠程連接到Quartz調度程序,所以我可以得到計劃運行的作業列表。在服務器應用程序,我用下面的代碼:遠程連接到Quartz Scheduler
NameValueCollection properties = new NameValueCollection();
properties.Add("quartz.scheduler.instanceName", "OlScheduler");
properties.Add("quartz.scheduler.instanceId", "Ol");
properties.Add("quartz.threadPool.type", "Quartz.Simpl.SimpleThreadPool, Quartz");
properties.Add("quartz.threadPool.threadCount", "5");
properties.Add("quartz.threadPool.threadPriority", "Normal");
properties.Add("quartz.scheduler.registryPort", "1099");
properties.Add("quartz.scheduler.rmi.export", "true");
properties.Add("quartz.scheduler.rmi.registryHost", "localhost");
properties.Add("quartz.scheduler.rmi.registryPort", "1099");
ISchedulerFactory sf = new StdSchedulerFactory(properties);
IScheduler sched = sf.GetScheduler();
和安裝並運行它作爲一個服務,然後從另一個應用程序,我用遠程連接到它:
properties["quartz.scheduler.instanceName"] = "RemoteClient";
properties["quartz.threadPool.type"] = "Quartz.Simpl.SimpleThreadPool, Quartz";
properties["quartz.threadPool.threadCount"] = "5";
properties["quartz.threadPool.threadPriority"] = "Normal";
properties["quartz.scheduler.proxy"] = "true";
properties["quartz.scheduler.proxy.address"] = "http://170.20.20.17:1099/OIService";
IScheduler sched = new StdSchedulerFactory(properties).GetScheduler();
,我得到的錯誤是: 「無法連接到遠程服務器」和「無法連接,因爲目標機器主動拒絕它172.22.22.17:1099」 我錯過了什麼?我正在使用Quartz.net版本1.1和RamJobStore,並且我的防火牆已關閉。 我認爲這是我使用錯誤的端口。任何幫助表示讚賞