Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
X
XXL-JOB
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
靳帅
XXL-JOB
Commits
7e651b55
提交
7e651b55
authored
6月 29, 2017
作者:
xuxueli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
springboot版本执行器,取消XML配置,改为类配置方式; ( From github user:FelixXu )
上级
628a1ac5
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
50 行增加
和
54 行删除
+50
-54
XXL-JOB官方文档.md
doc/XXL-JOB官方文档.md
+1
-0
XxlJobConfig.java
...n/java/com/xxl/job/executor/core/config/XxlJobConfig.java
+38
-2
IndexController.java
...ava/com/xxl/job/executor/mvc/handler/IndexController.java
+2
-1
application.properties
...ingboot-example/src/main/resources/application.properties
+9
-0
applicationcontext-xxl-job.xml
...example/src/main/resources/applicationcontext-xxl-job.xml
+0
-40
xxl-job-executor.properties
...ot-example/src/main/resources/xxl-job-executor.properties
+0
-11
没有找到文件。
doc/XXL-JOB官方文档.md
浏览文件 @
7e651b55
...
...
@@ -867,6 +867,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
-
6、执行器重复注册问题修复;
-
7、任务线程轮空30次后自动销毁,降低低频任务的无效线程消耗。
-
8、执行器任务执行结果批量回调,降低回调频率提升执行器性能;
-
9、springboot版本执行器,取消XML配置,改为类配置方式;
#### TODO LIST
-
1、任务权限管理:执行器为粒度分配权限,核心操作校验权限;
...
...
xxl-job-executor-springboot-example/src/main/java/com/xxl/job/executor/core/config/XxlJobConfig.java
浏览文件 @
7e651b55
package
com
.
xxl
.
job
.
executor
.
core
.
config
;
import
com.xxl.job.core.executor.XxlJobExecutor
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.ImportResource
;
@Configuration
@
ImportResource
(
"classpath:applicationcontext-xxl-job.xml
"
)
@
ComponentScan
(
basePackages
=
"com.xxl.job.executor.service.jobhandler
"
)
public
class
XxlJobConfig
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
XxlJobConfig
.
class
);
@Value
(
"${xxl.job.admin.addresses}"
)
private
String
addresses
;
@Value
(
"${xxl.job.executor.appname}"
)
private
String
appname
;
@Value
(
"${xxl.job.executor.ip}"
)
private
String
ip
;
@Value
(
"${xxl.job.executor.port}"
)
private
int
port
;
@Value
(
"${xxl.job.executor.logpath}"
)
private
String
logpath
;
@Bean
(
initMethod
=
"start"
,
destroyMethod
=
"destroy"
)
public
XxlJobExecutor
xxlJobExecutor
()
{
logger
.
error
(
"------------ xxlJobExecutor -----------"
);
XxlJobExecutor
xxlJobExecutor
=
new
XxlJobExecutor
();
xxlJobExecutor
.
setIp
(
ip
);
xxlJobExecutor
.
setPort
(
port
);
xxlJobExecutor
.
setAppName
(
appname
);
xxlJobExecutor
.
setAdminAddresses
(
addresses
);
xxlJobExecutor
.
setLogPath
(
logpath
);
return
xxlJobExecutor
;
}
}
\ No newline at end of file
xxl-job-executor-springboot-example/src/main/java/com/xxl/job/executor/mvc/handler/IndexController.java
浏览文件 @
7e651b55
...
...
@@ -12,7 +12,7 @@ public class IndexController {
@RequestMapping
(
"/"
)
@ResponseBody
String
index
()
{
return
"xxl job
is
running."
;
return
"xxl job
executor
running."
;
}
}
\ No newline at end of file
xxl-job-executor-springboot-example/src/main/resources/application.properties
浏览文件 @
7e651b55
...
...
@@ -4,5 +4,14 @@ server.port=8081
# log config
logging.config
=
classpath:logback.xml
# xxl-job
### xxl-job admin address list, such as "http://address" or "http://address01,http://address02"
xxl.job.admin.addresses
=
http://127.0.0.1:8080/xxl-job-admin
### xxl-job executor address
xxl.job.executor.appname
=
xxl-job-executor-example
xxl.job.executor.ip
=
xxl.job.executor.port
=
9999
### xxl-job log path
xxl.job.executor.logpath
=
/data/applogs/xxl-job/jobhandler/
xxl-job-executor-springboot-example/src/main/resources/applicationcontext-xxl-job.xml
deleted
100644 → 0
浏览文件 @
628a1ac5
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:context=
"http://www.springframework.org/schema/context"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd"
>
<bean
id=
"propertyConfigurer"
class=
"org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
>
<property
name=
"fileEncoding"
value=
"utf-8"
/>
<property
name=
"locations"
>
<list>
<value>
classpath*:xxl-job-executor.properties
</value>
</list>
</property>
</bean>
<!-- ********************************* 基础配置 ********************************* -->
<!-- 配置01、JobHandler 扫描路径 -->
<context:component-scan
base-package=
"com.xxl.job.executor.service.jobhandler"
/>
<!-- 配置02、执行器 -->
<bean
id=
"xxlJobExecutor"
class=
"com.xxl.job.core.executor.XxlJobExecutor"
init-method=
"start"
destroy-method=
"destroy"
>
<!-- 执行器IP[选填],为空则自动获取 -->
<property
name=
"ip"
value=
"${xxl.job.executor.ip}"
/>
<!-- 执行器端口号[必须] -->
<property
name=
"port"
value=
"${xxl.job.executor.port}"
/>
<!-- 执行器AppName[选填],为空则关闭自动注册 -->
<property
name=
"appName"
value=
"${xxl.job.executor.appname}"
/>
<!-- 执行器注册中心地址[选填],为空则关闭自动注册 -->
<property
name=
"adminAddresses"
value=
"${xxl.job.admin.addresses}"
/>
<!-- 执行器日志路径[必填] -->
<property
name=
"logPath"
value=
"${xxl.job.executor.logpath}"
/>
</bean>
</beans>
\ No newline at end of file
xxl-job-executor-springboot-example/src/main/resources/xxl-job-executor.properties
deleted
100644 → 0
浏览文件 @
628a1ac5
### xxl-job admin address list, such as "http://address" or "http://address01,http://address02"
xxl.job.admin.addresses
=
http://127.0.0.1:8080/xxl-job-admin
### xxl-job executor address
xxl.job.executor.appname
=
xxl-job-executor-example
xxl.job.executor.ip
=
xxl.job.executor.port
=
9999
### xxl-job log path
xxl.job.executor.logpath
=
/data/applogs/xxl-job/jobhandler/
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论