Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xxl-job-starter
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wengbinbin
xxl-job-starter
Commits
7a95f3aa
Commit
7a95f3aa
authored
Dec 11, 2019
by
wengbinbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
df890c02
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletions
+12
-1
README.md
README.md
+12
-1
No files found.
README.md
View file @
7a95f3aa
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
如何使用
如何使用
1.
项目中引入jar包
1.
项目中引入jar包
<dependency>
<dependency>
<groupId>com.ydl</groupId>
<groupId>com.ydl</groupId>
<artifactId>xxl-job-spring-boot-starter</artifactId>
<artifactId>xxl-job-spring-boot-starter</artifactId>
...
@@ -10,21 +11,29 @@
...
@@ -10,21 +11,29 @@
</dependency>
</dependency>
2.
配置application文件
2.
配置application文件
### 调度中心地址,集群可多地址
### 调度中心地址,集群可多地址
xxl.job.admin-addresses=http://121.41.92.140:8093/xxl-job-admin,http://121.41.92.140:8094/xxl-job-admin
xxl.job.admin-addresses=http://121.41.92.140:8093/xxl-job-admin,http://121.41.92.140:8094/xxl-job-admin
### 执行器名称,项目集群中名称一致。
### 执行器名称,项目集群中名称一致。
xxl.job.executor-appName=work-order
xxl.job.executor-appName=work-order
### 类似dubbo的端口,由运维为项目分配
### 类似dubbo的端口,由运维为项目分配
xxl.job.executor-port=9999
xxl.job.executor-port=9999
3.
项目中定时任务改写
3.
项目中定时任务改写
继承IJobHandler接口,execute方法中实现定时逻辑,注解JobHandler中定义value值
继承IJobHandler接口,execute方法中实现定时逻辑,注解JobHandler中定义value值
示例:
示例:
@JobHandler(value = "dispatchDuringTimeHandler")
@JobHandler(value = "dispatchDuringTimeHandler")
@Component
@Component
@Slf4j
@Slf4j
public class DispatchDuringTime extends IJobHandler {
public class DispatchDuringTime extends IJobHandler {
@Resource
@Resource
private CrmDispatchDataBiz crmDispatchDataBiz;
private CrmDispatchDataBiz crmDispatchDataBiz;
...
@@ -36,6 +45,8 @@
...
@@ -36,6 +45,8 @@
}
}
4.
调度中心中添加配置
4.
调度中心中添加配置
每个项目需添加执行管理器
每个项目需添加执行管理器
为每个JobHandler设置定时任务
为每个JobHandler设置定时任务
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment