Ver código fonte

配置同步

xueli.xue 8 anos atrás
pai
commit
3e1fe78eb4

+ 1 - 1
xxl-job-executor-example/src/main/resources/xxl-job-executor.properties Ver arquivo

@@ -1,4 +1,4 @@
1
-### xxl-job admin address, such as "http://host01:port01/project,http://host02:port02/project"
1
+### xxl-job admin address list, such as "http://address" or "http://address01,http://address02"
2 2
 xxl.job.admin.addresses=http://127.0.0.1:8080/xxl-job-admin
3 3
 
4 4
 ### xxl-job executor address

+ 9 - 30
xxl-job-executor-springboot-example/src/main/resources/applicationcontext-xxl-job.xml Ver arquivo

@@ -1,8 +1,8 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 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
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 6
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
7 7
            http://www.springframework.org/schema/context
8 8
            http://www.springframework.org/schema/context/spring-context-3.0.xsd">
@@ -16,7 +16,7 @@
16 16
 		</property>
17 17
 	</bean>
18 18
 
19
-    <!-- ********************************* 基础配置 ********************************* -->
19
+	<!-- ********************************* 基础配置 ********************************* -->
20 20
 
21 21
 	<!-- 配置01、JobHandler 扫描路径 -->
22 22
 	<context:component-scan base-package="com.xxl.job.executor.service.jobhandler" />
@@ -27,34 +27,13 @@
27 27
 		<property name="ip" value="${xxl.job.executor.ip}" />
28 28
 		<!-- 执行器端口号 -->
29 29
 		<property name="port" value="${xxl.job.executor.port}" />
30
-        <property name="appName" value="${xxl.job.executor.appname}" />
31
-        <!-- 执行器注册器 -->
32
-        <property name="registHelper" >
33
-            <!-- 执行器 "DbRegistHelper" 依赖 "XXL-JOB公共数据源" ;推荐将其抽象为RPC远程服务, 可取消对JDBC的依赖;如不启用执行自动注册功能,也可忽略JDBC配置;  -->
34
-            <bean class="com.xxl.job.core.registry.impl.DbRegistHelper" >
35
-                <!-- XXL-JOB公共数据源 -->
36
-                <property name="dataSource" ref="xxlJobDataSource" />
37
-            </bean>
38
-        </property>
30
+		<!-- 执行器AppName,为空则关闭自动注册 -->
31
+		<property name="appName" value="${xxl.job.executor.appname}" />
32
+		<!-- 执行器注册中心地址,为空则关闭自动注册 -->
33
+		<property name="adminAddresses" value="${xxl.job.admin.addresses}" />
34
+		<!-- 执行器日志路径 -->
39 35
 		<property name="logPath" value="${xxl.job.executor.logpath}" />
40 36
 	</bean>
41 37
 
42
-    <!-- ********************************* "XXL-JOB公共数据源" 配置, 仅在启动 "DbRegistHelper" 时才需要, 否则可删除 ********************************* -->
43
-
44
-	<!-- 配置03、XXL-JOB公共数据源 -->
45
-	<bean id="xxlJobDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
46
-		<property name="driverClass" value="${xxl.job.db.driverClass}" />
47
-		<property name="jdbcUrl" value="${xxl.job.db.url}" />
48
-		<property name="user" value="${xxl.job.db.user}" />
49
-		<property name="password" value="${xxl.job.db.password}" />
50
-		<property name="initialPoolSize" value="3" />
51
-		<property name="minPoolSize" value="2" />
52
-		<property name="maxPoolSize" value="10" />
53
-		<property name="maxIdleTime" value="60" />
54
-		<property name="acquireRetryDelay" value="1000" />
55
-		<property name="acquireRetryAttempts" value="10" />
56
-		<property name="preferredTestQuery" value="SELECT 1" />
57
-	</bean>
58
-
59 38
 
60 39
 </beans>

+ 2 - 5
xxl-job-executor-springboot-example/src/main/resources/xxl-job-executor.properties Ver arquivo

@@ -1,8 +1,5 @@
1
-### xxl-job db
2
-xxl.job.db.driverClass=com.mysql.jdbc.Driver
3
-xxl.job.db.url=jdbc:mysql://localhost:3306/xxl-job?useUnicode=true&characterEncoding=UTF-8
4
-xxl.job.db.user=root
5
-xxl.job.db.password=root_pwd
1
+### xxl-job admin address list, such as "http://address" or "http://address01,http://address02"
2
+xxl.job.admin.addresses=http://127.0.0.1:8080/xxl-job-admin
6 3
 
7 4
 ### xxl-job executor address
8 5
 xxl.job.executor.appname=xxl-job-executor-example