Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
X
XXL-JOB
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
靳帅
XXL-JOB
Commits
d54d679e
提交
d54d679e
authored
1月 09, 2019
作者:
xuxueli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
升级 xxl-rpc 依赖;
上级
bce7cc46
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
105 行增加
和
22 行删除
+105
-22
XXL-JOB官方文档.md
doc/XXL-JOB官方文档.md
+1
-1
pom.xml
pom.xml
+2
-2
XxlJobDynamicScheduler.java
...m/xxl/job/admin/core/schedule/XxlJobDynamicScheduler.java
+22
-4
AdminBizTest.java
...dmin/src/test/java/com/xxl/job/adminbiz/AdminBizTest.java
+25
-4
ExecutorBizTest.java
...n/src/test/java/com/xxl/job/executor/ExecutorBizTest.java
+13
-2
pom.xml
xxl-job-core/pom.xml
+20
-0
XxlJobExecutor.java
...c/main/java/com/xxl/job/core/executor/XxlJobExecutor.java
+22
-9
没有找到文件。
doc/XXL-JOB官方文档.md
浏览文件 @
d54d679e
...
@@ -1396,7 +1396,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
...
@@ -1396,7 +1396,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
-
1、调度中心告警邮件发送组件改为 “spring-boot-starter-mail”;
-
1、调度中心告警邮件发送组件改为 “spring-boot-starter-mail”;
-
2、任务告警逻辑调整,改为通过扫描失败日志方式触发。一方面精确扫描失败任务,降低扫描范围;另一方面取消内存队列,降低线程内存消耗;
-
2、任务告警逻辑调整,改为通过扫描失败日志方式触发。一方面精确扫描失败任务,降低扫描范围;另一方面取消内存队列,降低线程内存消耗;
-
3、记住密码功能优化,选中时永久记住;非选中时关闭浏览器即登出;
-
3、记住密码功能优化,选中时永久记住;非选中时关闭浏览器即登出;
-
4、项目依赖升级至较新稳定版本,如spring、jackson、groovy等等;
-
4、项目依赖升级至较新稳定版本,如spring、jackson、groovy
、xxl-rpc
等等;
-
5、精简项目,取消第三方依赖,如 commons-collections4 ;
-
5、精简项目,取消第三方依赖,如 commons-collections4 ;
-
[
迭代中
]
注册中心优化,实时性注册发现:心跳注册间隔10s,refresh失败则首次注册并立即更新注册信息,心跳类似;30s过期销毁;
-
[
迭代中
]
注册中心优化,实时性注册发现:心跳注册间隔10s,refresh失败则首次注册并立即更新注册信息,心跳类似;30s过期销毁;
-
[
迭代中
]
脚本任务,支持数据参数,新版本仅支持单参数不支持需要兼容;
-
[
迭代中
]
脚本任务,支持数据参数,新版本仅支持单参数不支持需要兼容;
...
...
pom.xml
浏览文件 @
d54d679e
...
@@ -24,7 +24,8 @@
...
@@ -24,7 +24,8 @@
<maven.compiler.target>
1.7
</maven.compiler.target>
<maven.compiler.target>
1.7
</maven.compiler.target>
<maven.test.skip>
true
</maven.test.skip>
<maven.test.skip>
true
</maven.test.skip>
<xxl-rpc.version>
1.2.1
</xxl-rpc.version>
<xxl-rpc.version>
1.3.1
</xxl-rpc.version>
<jetty-server.version>
9.2.26.v20180806
</jetty-server.version>
<spring-boot.version>
1.5.18.RELEASE
</spring-boot.version>
<spring-boot.version>
1.5.18.RELEASE
</spring-boot.version>
<mybatis-spring-boot-starter.version>
1.3.2
</mybatis-spring-boot-starter.version>
<mybatis-spring-boot-starter.version>
1.3.2
</mybatis-spring-boot-starter.version>
...
@@ -42,7 +43,6 @@
...
@@ -42,7 +43,6 @@
<quartz.version>
2.3.0
</quartz.version>
<quartz.version>
2.3.0
</quartz.version>
<jackson.version>
2.9.8
</jackson.version>
<jackson.version>
2.9.8
</jackson.version>
<jetty-server.version>
9.2.26.v20180806
</jetty-server.version>
</properties>
</properties>
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/core/schedule/XxlJobDynamicScheduler.java
浏览文件 @
d54d679e
...
@@ -13,6 +13,7 @@ import com.xxl.job.core.enums.ExecutorBlockStrategyEnum;
...
@@ -13,6 +13,7 @@ import com.xxl.job.core.enums.ExecutorBlockStrategyEnum;
import
com.xxl.rpc.remoting.invoker.XxlRpcInvokerFactory
;
import
com.xxl.rpc.remoting.invoker.XxlRpcInvokerFactory
;
import
com.xxl.rpc.remoting.invoker.call.CallType
;
import
com.xxl.rpc.remoting.invoker.call.CallType
;
import
com.xxl.rpc.remoting.invoker.reference.XxlRpcReferenceBean
;
import
com.xxl.rpc.remoting.invoker.reference.XxlRpcReferenceBean
;
import
com.xxl.rpc.remoting.invoker.route.LoadBalance
;
import
com.xxl.rpc.remoting.net.NetEnum
;
import
com.xxl.rpc.remoting.net.NetEnum
;
import
com.xxl.rpc.remoting.net.impl.jetty.server.JettyServerHandler
;
import
com.xxl.rpc.remoting.net.impl.jetty.server.JettyServerHandler
;
import
com.xxl.rpc.remoting.provider.XxlRpcProviderFactory
;
import
com.xxl.rpc.remoting.provider.XxlRpcProviderFactory
;
...
@@ -98,7 +99,14 @@ public final class XxlJobDynamicScheduler {
...
@@ -98,7 +99,14 @@ public final class XxlJobDynamicScheduler {
private
void
initRpcProvider
(){
private
void
initRpcProvider
(){
// init
// init
XxlRpcProviderFactory
xxlRpcProviderFactory
=
new
XxlRpcProviderFactory
();
XxlRpcProviderFactory
xxlRpcProviderFactory
=
new
XxlRpcProviderFactory
();
xxlRpcProviderFactory
.
initConfig
(
NetEnum
.
JETTY
,
Serializer
.
SerializeEnum
.
HESSIAN
.
getSerializer
(),
null
,
0
,
XxlJobAdminConfig
.
getAdminConfig
().
getAccessToken
(),
null
,
null
);
xxlRpcProviderFactory
.
initConfig
(
NetEnum
.
JETTY
,
Serializer
.
SerializeEnum
.
HESSIAN
.
getSerializer
(),
null
,
0
,
XxlJobAdminConfig
.
getAdminConfig
().
getAccessToken
(),
null
,
null
);
// add services
// add services
xxlRpcProviderFactory
.
addService
(
AdminBiz
.
class
.
getName
(),
null
,
XxlJobAdminConfig
.
getAdminConfig
().
getAdminBiz
());
xxlRpcProviderFactory
.
addService
(
AdminBiz
.
class
.
getName
(),
null
,
XxlJobAdminConfig
.
getAdminConfig
().
getAdminBiz
());
...
@@ -107,7 +115,7 @@ public final class XxlJobDynamicScheduler {
...
@@ -107,7 +115,7 @@ public final class XxlJobDynamicScheduler {
jettyServerHandler
=
new
JettyServerHandler
(
xxlRpcProviderFactory
);
jettyServerHandler
=
new
JettyServerHandler
(
xxlRpcProviderFactory
);
}
}
private
void
stopRpcProvider
()
throws
Exception
{
private
void
stopRpcProvider
()
throws
Exception
{
new
XxlRpcInvokerFactory
().
stop
();
XxlRpcInvokerFactory
.
getInstance
().
stop
();
}
}
public
static
void
invokeAdminService
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
,
ServletException
{
public
static
void
invokeAdminService
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
,
ServletException
{
jettyServerHandler
.
handle
(
null
,
new
Request
(
null
,
null
),
request
,
response
);
jettyServerHandler
.
handle
(
null
,
new
Request
(
null
,
null
),
request
,
response
);
...
@@ -130,8 +138,18 @@ public final class XxlJobDynamicScheduler {
...
@@ -130,8 +138,18 @@ public final class XxlJobDynamicScheduler {
}
}
// set-cache
// set-cache
executorBiz
=
(
ExecutorBiz
)
new
XxlRpcReferenceBean
(
NetEnum
.
JETTY
,
Serializer
.
SerializeEnum
.
HESSIAN
.
getSerializer
(),
CallType
.
SYNC
,
executorBiz
=
(
ExecutorBiz
)
new
XxlRpcReferenceBean
(
ExecutorBiz
.
class
,
null
,
10000
,
address
,
XxlJobAdminConfig
.
getAdminConfig
().
getAccessToken
(),
null
).
getObject
();
NetEnum
.
JETTY
,
Serializer
.
SerializeEnum
.
HESSIAN
.
getSerializer
(),
CallType
.
SYNC
,
LoadBalance
.
ROUND
,
ExecutorBiz
.
class
,
null
,
10000
,
address
,
XxlJobAdminConfig
.
getAdminConfig
().
getAccessToken
(),
null
,
null
).
getObject
();
executorBizRepository
.
put
(
address
,
executorBiz
);
executorBizRepository
.
put
(
address
,
executorBiz
);
return
executorBiz
;
return
executorBiz
;
...
...
xxl-job-admin/src/test/java/com/xxl/job/adminbiz/AdminBizTest.java
浏览文件 @
d54d679e
...
@@ -6,6 +6,7 @@ import com.xxl.job.core.biz.model.ReturnT;
...
@@ -6,6 +6,7 @@ import com.xxl.job.core.biz.model.ReturnT;
import
com.xxl.job.core.enums.RegistryConfig
;
import
com.xxl.job.core.enums.RegistryConfig
;
import
com.xxl.rpc.remoting.invoker.call.CallType
;
import
com.xxl.rpc.remoting.invoker.call.CallType
;
import
com.xxl.rpc.remoting.invoker.reference.XxlRpcReferenceBean
;
import
com.xxl.rpc.remoting.invoker.reference.XxlRpcReferenceBean
;
import
com.xxl.rpc.remoting.invoker.route.LoadBalance
;
import
com.xxl.rpc.remoting.net.NetEnum
;
import
com.xxl.rpc.remoting.net.NetEnum
;
import
com.xxl.rpc.serialize.Serializer
;
import
com.xxl.rpc.serialize.Serializer
;
import
org.junit.Assert
;
import
org.junit.Assert
;
...
@@ -30,8 +31,18 @@ public class AdminBizTest {
...
@@ -30,8 +31,18 @@ public class AdminBizTest {
@Test
@Test
public
void
registryTest
()
throws
Exception
{
public
void
registryTest
()
throws
Exception
{
addressUrl
=
addressUrl
.
replace
(
"http://"
,
""
);
addressUrl
=
addressUrl
.
replace
(
"http://"
,
""
);
AdminBiz
adminBiz
=
(
AdminBiz
)
new
XxlRpcReferenceBean
(
NetEnum
.
JETTY
,
Serializer
.
SerializeEnum
.
HESSIAN
.
getSerializer
(),
CallType
.
SYNC
,
AdminBiz
adminBiz
=
(
AdminBiz
)
new
XxlRpcReferenceBean
(
AdminBiz
.
class
,
null
,
10000
,
addressUrl
,
accessToken
,
null
).
getObject
();
NetEnum
.
JETTY
,
Serializer
.
SerializeEnum
.
HESSIAN
.
getSerializer
(),
CallType
.
SYNC
,
LoadBalance
.
ROUND
,
AdminBiz
.
class
,
null
,
10000
,
addressUrl
,
accessToken
,
null
,
null
).
getObject
();
// test executor registry
// test executor registry
RegistryParam
registryParam
=
new
RegistryParam
(
RegistryConfig
.
RegistType
.
EXECUTOR
.
name
(),
"xxl-job-executor-example"
,
"127.0.0.1:9999"
);
RegistryParam
registryParam
=
new
RegistryParam
(
RegistryConfig
.
RegistType
.
EXECUTOR
.
name
(),
"xxl-job-executor-example"
,
"127.0.0.1:9999"
);
...
@@ -47,8 +58,18 @@ public class AdminBizTest {
...
@@ -47,8 +58,18 @@ public class AdminBizTest {
@Test
@Test
public
void
registryRemove
()
throws
Exception
{
public
void
registryRemove
()
throws
Exception
{
addressUrl
=
addressUrl
.
replace
(
"http://"
,
""
);
addressUrl
=
addressUrl
.
replace
(
"http://"
,
""
);
AdminBiz
adminBiz
=
(
AdminBiz
)
new
XxlRpcReferenceBean
(
NetEnum
.
JETTY
,
Serializer
.
SerializeEnum
.
HESSIAN
.
getSerializer
(),
CallType
.
SYNC
,
AdminBiz
adminBiz
=
(
AdminBiz
)
new
XxlRpcReferenceBean
(
AdminBiz
.
class
,
null
,
10000
,
addressUrl
,
accessToken
,
null
).
getObject
();
NetEnum
.
JETTY
,
Serializer
.
SerializeEnum
.
HESSIAN
.
getSerializer
(),
CallType
.
SYNC
,
LoadBalance
.
ROUND
,
AdminBiz
.
class
,
null
,
10000
,
addressUrl
,
accessToken
,
null
,
null
).
getObject
();
// test executor registry remove
// test executor registry remove
RegistryParam
registryParam
=
new
RegistryParam
(
RegistryConfig
.
RegistType
.
EXECUTOR
.
name
(),
"xxl-job-executor-example"
,
"127.0.0.1:9999"
);
RegistryParam
registryParam
=
new
RegistryParam
(
RegistryConfig
.
RegistType
.
EXECUTOR
.
name
(),
"xxl-job-executor-example"
,
"127.0.0.1:9999"
);
...
...
xxl-job-admin/src/test/java/com/xxl/job/executor/ExecutorBizTest.java
浏览文件 @
d54d679e
...
@@ -7,6 +7,7 @@ import com.xxl.job.core.enums.ExecutorBlockStrategyEnum;
...
@@ -7,6 +7,7 @@ import com.xxl.job.core.enums.ExecutorBlockStrategyEnum;
import
com.xxl.job.core.glue.GlueTypeEnum
;
import
com.xxl.job.core.glue.GlueTypeEnum
;
import
com.xxl.rpc.remoting.invoker.call.CallType
;
import
com.xxl.rpc.remoting.invoker.call.CallType
;
import
com.xxl.rpc.remoting.invoker.reference.XxlRpcReferenceBean
;
import
com.xxl.rpc.remoting.invoker.reference.XxlRpcReferenceBean
;
import
com.xxl.rpc.remoting.invoker.route.LoadBalance
;
import
com.xxl.rpc.remoting.net.NetEnum
;
import
com.xxl.rpc.remoting.net.NetEnum
;
import
com.xxl.rpc.serialize.Serializer
;
import
com.xxl.rpc.serialize.Serializer
;
...
@@ -47,8 +48,18 @@ public class ExecutorBizTest {
...
@@ -47,8 +48,18 @@ public class ExecutorBizTest {
// do remote trigger
// do remote trigger
String
accessToken
=
null
;
String
accessToken
=
null
;
ExecutorBiz
executorBiz
=
(
ExecutorBiz
)
new
XxlRpcReferenceBean
(
NetEnum
.
JETTY
,
Serializer
.
SerializeEnum
.
HESSIAN
.
getSerializer
(),
CallType
.
SYNC
,
ExecutorBiz
executorBiz
=
(
ExecutorBiz
)
new
XxlRpcReferenceBean
(
ExecutorBiz
.
class
,
null
,
10000
,
"127.0.0.1:9999"
,
null
,
null
).
getObject
();
NetEnum
.
JETTY
,
Serializer
.
SerializeEnum
.
HESSIAN
.
getSerializer
(),
CallType
.
SYNC
,
LoadBalance
.
ROUND
,
ExecutorBiz
.
class
,
null
,
10000
,
"127.0.0.1:9999"
,
null
,
null
,
null
).
getObject
();
ReturnT
<
String
>
runResult
=
executorBiz
.
run
(
triggerParam
);
ReturnT
<
String
>
runResult
=
executorBiz
.
run
(
triggerParam
);
}
}
...
...
xxl-job-core/pom.xml
浏览文件 @
d54d679e
...
@@ -20,6 +20,26 @@
...
@@ -20,6 +20,26 @@
<groupId>
com.xuxueli
</groupId>
<groupId>
com.xuxueli
</groupId>
<artifactId>
xxl-rpc-core
</artifactId>
<artifactId>
xxl-rpc-core
</artifactId>
<version>
${xxl-rpc.version}
</version>
<version>
${xxl-rpc.version}
</version>
<exclusions>
<exclusion>
<groupId>
io.netty
</groupId>
<artifactId>
netty-all
</artifactId>
</exclusion>
<exclusion>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-pool2
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.eclipse.jetty
</groupId>
<artifactId>
jetty-server
</artifactId>
<version>
${jetty-server.version}
</version>
</dependency>
<dependency>
<groupId>
org.eclipse.jetty
</groupId>
<artifactId>
jetty-client
</artifactId>
<version>
${jetty-server.version}
</version>
</dependency>
</dependency>
<!-- groovy-all -->
<!-- groovy-all -->
...
...
xxl-job-core/src/main/java/com/xxl/job/core/executor/XxlJobExecutor.java
浏览文件 @
d54d679e
...
@@ -13,6 +13,7 @@ import com.xxl.rpc.registry.ServiceRegistry;
...
@@ -13,6 +13,7 @@ import com.xxl.rpc.registry.ServiceRegistry;
import
com.xxl.rpc.remoting.invoker.XxlRpcInvokerFactory
;
import
com.xxl.rpc.remoting.invoker.XxlRpcInvokerFactory
;
import
com.xxl.rpc.remoting.invoker.call.CallType
;
import
com.xxl.rpc.remoting.invoker.call.CallType
;
import
com.xxl.rpc.remoting.invoker.reference.XxlRpcReferenceBean
;
import
com.xxl.rpc.remoting.invoker.reference.XxlRpcReferenceBean
;
import
com.xxl.rpc.remoting.invoker.route.LoadBalance
;
import
com.xxl.rpc.remoting.net.NetEnum
;
import
com.xxl.rpc.remoting.net.NetEnum
;
import
com.xxl.rpc.remoting.provider.XxlRpcProviderFactory
;
import
com.xxl.rpc.remoting.provider.XxlRpcProviderFactory
;
import
com.xxl.rpc.serialize.Serializer
;
import
com.xxl.rpc.serialize.Serializer
;
...
@@ -113,8 +114,19 @@ public class XxlJobExecutor {
...
@@ -113,8 +114,19 @@ public class XxlJobExecutor {
String
addressUrl
=
address
.
concat
(
AdminBiz
.
MAPPING
);
String
addressUrl
=
address
.
concat
(
AdminBiz
.
MAPPING
);
AdminBiz
adminBiz
=
(
AdminBiz
)
new
XxlRpcReferenceBean
(
NetEnum
.
JETTY
,
Serializer
.
SerializeEnum
.
HESSIAN
.
getSerializer
(),
CallType
.
SYNC
,
AdminBiz
adminBiz
=
(
AdminBiz
)
new
XxlRpcReferenceBean
(
AdminBiz
.
class
,
null
,
10000
,
addressUrl
,
accessToken
,
null
).
getObject
();
NetEnum
.
JETTY
,
Serializer
.
SerializeEnum
.
HESSIAN
.
getSerializer
(),
CallType
.
SYNC
,
LoadBalance
.
ROUND
,
AdminBiz
.
class
,
null
,
10000
,
addressUrl
,
accessToken
,
null
,
null
).
getObject
();
if
(
adminBizList
==
null
)
{
if
(
adminBizList
==
null
)
{
adminBizList
=
new
ArrayList
<
AdminBiz
>();
adminBizList
=
new
ArrayList
<
AdminBiz
>();
...
@@ -130,12 +142,9 @@ public class XxlJobExecutor {
...
@@ -130,12 +142,9 @@ public class XxlJobExecutor {
// ---------------------- executor-server (rpc provider) ----------------------
// ---------------------- executor-server (rpc provider) ----------------------
private
XxlRpcInvokerFactory
xxlRpcInvokerFactory
=
null
;
private
XxlRpcProviderFactory
xxlRpcProviderFactory
=
null
;
private
XxlRpcProviderFactory
xxlRpcProviderFactory
=
null
;
private
void
initRpcProvider
(
String
ip
,
int
port
,
String
appName
,
String
accessToken
)
throws
Exception
{
private
void
initRpcProvider
(
String
ip
,
int
port
,
String
appName
,
String
accessToken
)
throws
Exception
{
// init invoker factory
xxlRpcInvokerFactory
=
new
XxlRpcInvokerFactory
();
// init, provider factory
// init, provider factory
String
address
=
IpUtil
.
getIpPort
(
ip
,
port
);
String
address
=
IpUtil
.
getIpPort
(
ip
,
port
);
...
@@ -150,7 +159,7 @@ public class XxlJobExecutor {
...
@@ -150,7 +159,7 @@ public class XxlJobExecutor {
xxlRpcProviderFactory
.
addService
(
ExecutorBiz
.
class
.
getName
(),
null
,
new
ExecutorBizImpl
());
xxlRpcProviderFactory
.
addService
(
ExecutorBiz
.
class
.
getName
(),
null
,
new
ExecutorBizImpl
());
// start
// start
xxlRpcProviderFactory
.
start
();
xxlRpcProviderFactory
.
start
();
}
}
...
@@ -168,14 +177,18 @@ public class XxlJobExecutor {
...
@@ -168,14 +177,18 @@ public class XxlJobExecutor {
}
}
@Override
@Override
public
boolean
registry
(
S
tring
key
,
String
value
)
{
public
boolean
registry
(
S
et
<
String
>
keys
,
String
value
)
{
return
false
;
return
false
;
}
}
@Override
@Override
public
boolean
remove
(
S
tring
key
,
String
value
)
{
public
boolean
remove
(
S
et
<
String
>
keys
,
String
value
)
{
return
false
;
return
false
;
}
}
@Override
@Override
public
Map
<
String
,
TreeSet
<
String
>>
discovery
(
Set
<
String
>
keys
)
{
return
null
;
}
@Override
public
TreeSet
<
String
>
discovery
(
String
key
)
{
public
TreeSet
<
String
>
discovery
(
String
key
)
{
return
null
;
return
null
;
}
}
...
@@ -185,7 +198,7 @@ public class XxlJobExecutor {
...
@@ -185,7 +198,7 @@ public class XxlJobExecutor {
private
void
stopRpcProvider
()
{
private
void
stopRpcProvider
()
{
// stop invoker factory
// stop invoker factory
try
{
try
{
xxlRpcInvokerFactory
.
stop
();
XxlRpcInvokerFactory
.
getInstance
()
.
stop
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
logger
.
error
(
e
.
getMessage
(),
e
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论