xxl-job

applicationcontext-xxl-job.xml 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:context="http://www.springframework.org/schema/context"
  5. xsi:schemaLocation="http://www.springframework.org/schema/beans
  6. http://www.springframework.org/schema/beans/spring-beans.xsd
  7. http://www.springframework.org/schema/context
  8. http://www.springframework.org/schema/context/spring-context.xsd">
  9. <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  10. <property name="fileEncoding" value="utf-8" />
  11. <property name="locations">
  12. <list>
  13. <value>classpath*:xxl-job-executor.properties</value>
  14. </list>
  15. </property>
  16. </bean>
  17. <!-- ********************************* 基础配置 ********************************* -->
  18. <!-- 配置01、JobHandler 扫描路径 -->
  19. <context:component-scan base-package="com.xxl.job.executor.service.jobhandler" />
  20. <!-- 配置02、执行器 -->
  21. <bean id="xxlJobSpringExecutor" class="com.xxl.job.core.executor.impl.XxlJobSpringExecutor" init-method="start" destroy-method="destroy" >
  22. <!-- 执行器注册中心地址[选填],为空则关闭自动注册 -->
  23. <property name="adminAddresses" value="${xxl.job.admin.addresses}" />
  24. <!-- 执行器AppName[选填],为空则关闭自动注册 -->
  25. <property name="appName" value="${xxl.job.executor.appname}" />
  26. <!-- 执行器IP[选填],为空则自动获取 -->
  27. <property name="ip" value="${xxl.job.executor.ip}" />
  28. <!-- 执行器端口号[选填],小于等于0则自动获取 -->
  29. <property name="port" value="${xxl.job.executor.port}" />
  30. <!-- 访问令牌[选填],非空则进行匹配校验 -->
  31. <property name="accessToken" value="${xxl.job.accessToken}" />
  32. <!-- 执行器日志路径[选填],为空则使用默认路径 -->
  33. <property name="logPath" value="${xxl.job.executor.logpath}" />
  34. <!-- 日志保存天数[选填],值大于3时生效 -->
  35. <property name="logRetentionDays" value="${xxl.job.executor.logretentiondays}" />
  36. </bean>
  37. </beans>