applicationcontext-xxl-job.xml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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-3.0.xsd
  7. http://www.springframework.org/schema/context
  8. http://www.springframework.org/schema/context/spring-context-3.0.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="xxlJobExecutor" class="com.xxl.job.core.executor.XxlJobExecutor" init-method="start" destroy-method="destroy" >
  22. <!-- 执行器IP[选填],为空则自动获取 -->
  23. <property name="ip" value="${xxl.job.executor.ip}" />
  24. <!-- 执行器端口号[必须] -->
  25. <property name="port" value="${xxl.job.executor.port}" />
  26. <!-- 执行器AppName[选填],为空则关闭自动注册 -->
  27. <property name="appName" value="${xxl.job.executor.appname}" />
  28. <!-- 执行器注册中心地址[选填],为空则关闭自动注册 -->
  29. <property name="adminAddresses" value="${xxl.job.admin.addresses}" />
  30. <!-- 执行器日志路径[必填] -->
  31. <property name="logPath" value="${xxl.job.executor.logpath}" />
  32. </bean>
  33. </beans>