http://unmi.cc/quartz-job-scheduling-framework-9-3/
http://unmi.cc/quartz-job-scheduling-framework-9-2/
服务器
主要参数
<bean id="common_scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean" autowire="no"> <property name="quartzProperties"> <props> <prop key="org.quartz.jobStore.tablePrefix">QRTZ_</prop> <prop key="org.quartz.scheduler.instanceId">inst2</prop> <prop key="org.quartz.scheduler.instanceName">common_scheduler</prop> <prop key="org.quartz.threadPool.class">org.quartz.simpl.SimpleThreadPool</prop> <prop key="org.quartz.threadPool.threadCount">100</prop> <prop key="org.quartz.threadPool.threadPriority">5</prop> <!--rmi 参数--> <prop key="org.quartz.scheduler.rmi.export">true</prop> <prop key="org.quartz.scheduler.rmi.serverPort">0</prop> <prop key="org.quartz.scheduler.rmi.registryHost">localhost</prop> <prop key="org.quartz.scheduler.rmi.registryPort">8888</prop> <prop key="org.quartz.scheduler.rmi.createRegistry">true</prop> <prop key="org.quartz.jobStore.misfireThreshold">60000</prop> <!-- <prop key="org.quartz.jobStore.class">org.quartz.simpl.RAMJobStore</prop>--> </props> </property>
标准启动:
Scheduler scheduler =
StdSchedulerFactory.getDefaultScheduler();
/*
* Due to the server.properties file, our Scheduler will
* be exported to RMI Registry automatically.
*/
scheduler.start();
客服端RMI调用配置:
client.properties
#=============================================================
# Configure Main Scheduler Properties
#=============================================================
--- remote 相同instanceName,instanceId
org.quartz.scheduler.instanceName = common_scheduler
org.quartz.scheduler.instanceId = inst2
org.quartz.threadPool.threadCount = 10
org.quartz.threadPool.threadPriority = 5
#==============================================================
#Configure RMI Properties
#==============================================================
org.quartz.scheduler.rmi.registryHost=192.168.4.110
org.quartz.scheduler.rmi.registryPort=8888
org.quartz.scheduler.rmi.proxy= true
#org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
#org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
// Use this properties file instead of quartz.properties
System.setProperty("org.quartz.properties",
"client.properties");
// Get a reference to the remote scheduler
Scheduler scheduler =
StdSchedulerFactory.getDefaultScheduler();