Quartz远程调用

 

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();    
 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值