Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
SkyWalking
提交
e200ef10
S
SkyWalking
项目概览
apache
/
SkyWalking
上一次同步 1 年多
通知
302
Star
21345
Fork
6091
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
e200ef10
编写于
9月 20, 2020
作者:
H
hailin0
提交者:
GitHub
9月 20, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add support for xxl-job (#5519)
上级
266414f2
变更
36
隐藏空白更改
内联
并排
Showing
36 changed file
with
1773 addition
and
1 deletion
+1773
-1
.github/workflows/plugins-test.3.yaml
.github/workflows/plugins-test.3.yaml
+1
-0
apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java
...walking/apm/network/trace/component/ComponentsDefine.java
+2
-0
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/match/MultiClassNameMatch.java
...king/apm/agent/core/plugin/match/MultiClassNameMatch.java
+1
-1
apm-sniffer/apm-sdk-plugin/pom.xml
apm-sniffer/apm-sdk-plugin/pom.xml
+1
-0
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/pom.xml
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/pom.xml
+46
-0
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xxljob/Constants.java
...va/org/apache/skywalking/apm/plugin/xxljob/Constants.java
+32
-0
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xxljob/MethodJobHandlerConstructorInterceptor.java
...plugin/xxljob/MethodJobHandlerConstructorInterceptor.java
+46
-0
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xxljob/MethodJobHandlerMethodInterceptor.java
.../apm/plugin/xxljob/MethodJobHandlerMethodInterceptor.java
+61
-0
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xxljob/ScriptJobHandlerConstructorInterceptor.java
...plugin/xxljob/ScriptJobHandlerConstructorInterceptor.java
+39
-0
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xxljob/ScriptJobHandlerMethodInterceptor.java
.../apm/plugin/xxljob/ScriptJobHandlerMethodInterceptor.java
+61
-0
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xxljob/SimpleJobHandlerMethodInterceptor.java
.../apm/plugin/xxljob/SimpleJobHandlerMethodInterceptor.java
+60
-0
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xxljob/define/MethodJobHandlerInstrumentation.java
...plugin/xxljob/define/MethodJobHandlerInstrumentation.java
+99
-0
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xxljob/define/ScriptJobHandlerInstrumentation.java
...plugin/xxljob/define/ScriptJobHandlerInstrumentation.java
+93
-0
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xxljob/define/SimpleJobHandlerInstrumentation.java
...plugin/xxljob/define/SimpleJobHandlerInstrumentation.java
+92
-0
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/src/main/resources/skywalking-plugin.def
...l-job-2.x-plugin/src/main/resources/skywalking-plugin.def
+19
-0
docs/en/setup/service-agent/java-agent/Plugin-list.md
docs/en/setup/service-agent/java-agent/Plugin-list.md
+1
-0
docs/en/setup/service-agent/java-agent/Supported-list.md
docs/en/setup/service-agent/java-agent/Supported-list.md
+1
-0
oap-server/server-bootstrap/src/main/resources/component-libraries.yml
...rver-bootstrap/src/main/resources/component-libraries.yml
+3
-0
oap-server/server-core/src/test/resources/component-libraries.yml
...er/server-core/src/test/resources/component-libraries.yml
+3
-0
test/plugin/scenarios/xxl-job-2.x-scenario/bin/startup.sh
test/plugin/scenarios/xxl-job-2.x-scenario/bin/startup.sh
+21
-0
test/plugin/scenarios/xxl-job-2.x-scenario/config/expectedData.yaml
...n/scenarios/xxl-job-2.x-scenario/config/expectedData.yaml
+189
-0
test/plugin/scenarios/xxl-job-2.x-scenario/configuration.yml
test/plugin/scenarios/xxl-job-2.x-scenario/configuration.yml
+40
-0
test/plugin/scenarios/xxl-job-2.x-scenario/pom.xml
test/plugin/scenarios/xxl-job-2.x-scenario/pom.xml
+143
-0
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/assembly/assembly.xml
...arios/xxl-job-2.x-scenario/src/main/assembly/assembly.xml
+41
-0
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/xxljob/Application.java
...rg/apache/skywalking/apm/testcase/xxljob/Application.java
+32
-0
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/xxljob/Utils.java
...java/org/apache/skywalking/apm/testcase/xxljob/Utils.java
+33
-0
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/xxljob/controller/CaseController.java
...alking/apm/testcase/xxljob/controller/CaseController.java
+70
-0
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/xxljob/job/MethodJob.java
.../apache/skywalking/apm/testcase/xxljob/job/MethodJob.java
+46
-0
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/xxljob/job/XXLJobConfig.java
...ache/skywalking/apm/testcase/xxljob/job/XXLJobConfig.java
+67
-0
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/xxljob/job/XXLJobInitializer.java
...skywalking/apm/testcase/xxljob/job/XXLJobInitializer.java
+56
-0
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/xxljob/service/XXLJobServerControlService.java
...m/testcase/xxljob/service/XXLJobServerControlService.java
+116
-0
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/xxljob/job/BeanJob.java
...rg/apache/skywalking/apm/testcase/xxljob/job/BeanJob.java
+42
-0
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/resources/application.yaml
.../xxl-job-2.x-scenario/src/main/resources/application.yaml
+35
-0
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/resources/log4j2.xml
...narios/xxl-job-2.x-scenario/src/main/resources/log4j2.xml
+30
-0
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/resources/tables_xxl_job.sql
...xl-job-2.x-scenario/src/main/resources/tables_xxl_job.sql
+133
-0
test/plugin/scenarios/xxl-job-2.x-scenario/support-version.list
...lugin/scenarios/xxl-job-2.x-scenario/support-version.list
+18
-0
未找到文件。
.github/workflows/plugins-test.3.yaml
浏览文件 @
e200ef10
...
...
@@ -58,6 +58,7 @@ jobs:
-
{
name
:
'
spring-scheduled-scenario'
,
title
:
'
Spring
Scheduled
3.1.x-5.2.x
(9)'
}
-
{
name
:
'
elasticjob-2.x-scenario'
,
title
:
'
elasticjob-2.x-scenario
(2)'
}
-
{
name
:
'
quartz-scheduler-2.x-scenario'
,
title
:
'
quartz-scheduler-2.x-scenario
(5)'
}
-
{
name
:
'
xxl-job-2.x-scenario'
,
title
:
'
xxl-job-2.x-scenario
(1)'
}
steps
:
-
uses
:
actions/checkout@v2
with
:
...
...
apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java
浏览文件 @
e200ef10
...
...
@@ -176,4 +176,6 @@ public class ComponentsDefine {
public
static
final
OfficialComponent
SPRING_SCHEDULED
=
new
OfficialComponent
(
96
,
"SpringScheduled"
);
public
static
final
OfficialComponent
QUARTZ_SCHEDULER
=
new
OfficialComponent
(
97
,
"quartz-scheduler"
);
public
static
final
OfficialComponent
XXL_JOB
=
new
OfficialComponent
(
98
,
"xxl-job"
);
}
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/match/MultiClassNameMatch.java
浏览文件 @
e200ef10
...
...
@@ -57,7 +57,7 @@ public class MultiClassNameMatch implements IndirectMatch {
return
matchClassNames
.
contains
(
typeDescription
.
getTypeName
());
}
public
static
Class
Match
byMultiClassMatch
(
String
...
classNames
)
{
public
static
Indirect
Match
byMultiClassMatch
(
String
...
classNames
)
{
return
new
MultiClassNameMatch
(
classNames
);
}
}
apm-sniffer/apm-sdk-plugin/pom.xml
浏览文件 @
e200ef10
...
...
@@ -98,6 +98,7 @@
<module>
baidu-brpc-plugin
</module>
<module>
hbase-1.x-plugin
</module>
<module>
graphql-plugin
</module>
<module>
xxl-job-2.x-plugin
</module>
</modules>
<packaging>
pom
</packaging>
...
...
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/pom.xml
0 → 100644
浏览文件 @
e200ef10
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
apm-sdk-plugin
</artifactId>
<groupId>
org.apache.skywalking
</groupId>
<version>
8.2.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
apm-xxl-job-2.x-plugin
</artifactId>
<packaging>
jar
</packaging>
<name>
xxl-job-2.x-plugin
</name>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>
com.xuxueli
</groupId>
<artifactId>
xxl-job-core
</artifactId>
<version>
2.2.0
</version>
<scope>
provided
</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xxljob/Constants.java
0 → 100644
浏览文件 @
e200ef10
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.plugin.xxljob
;
import
org.apache.skywalking.apm.agent.core.context.tag.AbstractTag
;
import
org.apache.skywalking.apm.agent.core.context.tag.Tags
;
public
class
Constants
{
public
static
final
String
XXL_IJOB_HANDLER
=
"com.xxl.job.core.handler.IJobHandler"
;
public
static
final
String
XXL_GLUE_JOB_HANDLER
=
"com.xxl.job.core.handler.impl.GlueJobHandler"
;
public
static
final
String
XXL_SCRIPT_JOB_HANDLER
=
"com.xxl.job.core.handler.impl.ScriptJobHandler"
;
public
static
final
String
XXL_METHOD_JOB_HANDLER
=
"com.xxl.job.core.handler.impl.MethodJobHandler"
;
public
static
final
AbstractTag
JOB_PARAM
=
Tags
.
ofKey
(
"jobParam"
);
}
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xxljob/MethodJobHandlerConstructorInterceptor.java
0 → 100644
浏览文件 @
e200ef10
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.plugin.xxljob
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor
;
import
java.lang.reflect.Method
;
/**
* Intercept method of {@link com.xxl.job.core.handler.impl.MethodJobHandler#MethodJobHandler(java.lang.Object, java.lang.reflect.Method, java.lang.reflect.Method, java.lang.reflect.Method)}.
* cache the job target method details.
*/
public
class
MethodJobHandlerConstructorInterceptor
implements
InstanceConstructorInterceptor
{
@Override
public
void
onConstruct
(
EnhancedInstance
objInst
,
Object
[]
allArguments
)
throws
Throwable
{
Method
method
=
(
Method
)
allArguments
[
1
];
String
methodName
=
buildMethodName
(
method
);
objInst
.
setSkyWalkingDynamicField
(
methodName
);
}
protected
String
buildMethodName
(
Method
method
)
{
String
className
=
method
.
getDeclaringClass
().
getName
();
String
methodName
=
method
.
getName
();
return
className
+
"."
+
methodName
;
}
}
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xxljob/MethodJobHandlerMethodInterceptor.java
0 → 100644
浏览文件 @
e200ef10
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.plugin.xxljob
;
import
org.apache.skywalking.apm.agent.core.context.ContextManager
;
import
org.apache.skywalking.apm.agent.core.context.tag.Tags
;
import
org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult
;
import
org.apache.skywalking.apm.network.trace.component.ComponentsDefine
;
import
java.lang.reflect.Method
;
import
static
org
.
apache
.
skywalking
.
apm
.
plugin
.
xxljob
.
Constants
.
JOB_PARAM
;
/**
* Intercept method of {@link com.xxl.job.core.handler.impl.MethodJobHandler#execute(String)}.
* record the xxl-job method job local span.
*/
public
class
MethodJobHandlerMethodInterceptor
implements
InstanceMethodsAroundInterceptor
{
@Override
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
MethodInterceptResult
result
)
throws
Throwable
{
String
methodName
=
(
String
)
objInst
.
getSkyWalkingDynamicField
();
String
jobParam
=
(
String
)
allArguments
[
0
];
String
operationName
=
ComponentsDefine
.
XXL_JOB
.
getName
()
+
"/MethodJob/"
+
methodName
;
AbstractSpan
span
=
ContextManager
.
createLocalSpan
(
operationName
);
span
.
setComponent
(
ComponentsDefine
.
XXL_JOB
);
Tags
.
LOGIC_ENDPOINT
.
set
(
span
,
Tags
.
VAL_LOCAL_SPAN_AS_LOGIC_ENDPOINT
);
span
.
tag
(
JOB_PARAM
,
jobParam
);
}
@Override
public
Object
afterMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Object
ret
)
throws
Throwable
{
ContextManager
.
stopSpan
();
return
ret
;
}
@Override
public
void
handleMethodException
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Throwable
t
)
{
ContextManager
.
activeSpan
().
log
(
t
);
}
}
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xxljob/ScriptJobHandlerConstructorInterceptor.java
0 → 100644
浏览文件 @
e200ef10
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.plugin.xxljob
;
import
com.xxl.job.core.glue.GlueTypeEnum
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor
;
/**
* Intercept method of {@link com.xxl.job.core.handler.impl.ScriptJobHandler#ScriptJobHandler(int, long, java.lang.String, com.xxl.job.core.glue.GlueTypeEnum)}.
* cache the script job details.
*/
public
class
ScriptJobHandlerConstructorInterceptor
implements
InstanceConstructorInterceptor
{
@Override
public
void
onConstruct
(
EnhancedInstance
objInst
,
Object
[]
allArguments
)
throws
Throwable
{
int
jobId
=
(
int
)
allArguments
[
0
];
GlueTypeEnum
glueType
=
(
GlueTypeEnum
)
allArguments
[
3
];
String
jobName
=
glueType
.
name
()
+
"/id/"
+
jobId
;
objInst
.
setSkyWalkingDynamicField
(
jobName
);
}
}
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xxljob/ScriptJobHandlerMethodInterceptor.java
0 → 100644
浏览文件 @
e200ef10
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.plugin.xxljob
;
import
org.apache.skywalking.apm.agent.core.context.ContextManager
;
import
org.apache.skywalking.apm.agent.core.context.tag.Tags
;
import
org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult
;
import
org.apache.skywalking.apm.network.trace.component.ComponentsDefine
;
import
java.lang.reflect.Method
;
import
static
org
.
apache
.
skywalking
.
apm
.
plugin
.
xxljob
.
Constants
.
JOB_PARAM
;
/**
* Intercept method of {@link com.xxl.job.core.handler.impl.ScriptJobHandler#execute(String)}.
* record the xxl-job script job local span.
*/
public
class
ScriptJobHandlerMethodInterceptor
implements
InstanceMethodsAroundInterceptor
{
@Override
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
MethodInterceptResult
result
)
throws
Throwable
{
String
jobTypeAndId
=
(
String
)
objInst
.
getSkyWalkingDynamicField
();
String
jobParam
=
(
String
)
allArguments
[
0
];
String
operationName
=
ComponentsDefine
.
XXL_JOB
.
getName
()
+
"/ScriptJob/"
+
jobTypeAndId
;
AbstractSpan
span
=
ContextManager
.
createLocalSpan
(
operationName
);
span
.
setComponent
(
ComponentsDefine
.
XXL_JOB
);
Tags
.
LOGIC_ENDPOINT
.
set
(
span
,
Tags
.
VAL_LOCAL_SPAN_AS_LOGIC_ENDPOINT
);
span
.
tag
(
JOB_PARAM
,
jobParam
);
}
@Override
public
Object
afterMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Object
ret
)
throws
Throwable
{
ContextManager
.
stopSpan
();
return
ret
;
}
@Override
public
void
handleMethodException
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Throwable
t
)
{
ContextManager
.
activeSpan
().
log
(
t
);
}
}
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xxljob/SimpleJobHandlerMethodInterceptor.java
0 → 100644
浏览文件 @
e200ef10
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.plugin.xxljob
;
import
org.apache.skywalking.apm.agent.core.context.ContextManager
;
import
org.apache.skywalking.apm.agent.core.context.tag.Tags
;
import
org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult
;
import
org.apache.skywalking.apm.network.trace.component.ComponentsDefine
;
import
java.lang.reflect.Method
;
import
static
org
.
apache
.
skywalking
.
apm
.
plugin
.
xxljob
.
Constants
.
JOB_PARAM
;
/**
* Intercept execute(String) method on implement class of {@link com.xxl.job.core.handler.IJobHandler}.
* record the xxl-job simple job local span.
*/
public
class
SimpleJobHandlerMethodInterceptor
implements
InstanceMethodsAroundInterceptor
{
@Override
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
MethodInterceptResult
result
)
throws
Throwable
{
String
jobParam
=
(
String
)
allArguments
[
0
];
String
operationName
=
ComponentsDefine
.
XXL_JOB
.
getName
()
+
"/SimpleJob/"
+
method
.
getDeclaringClass
().
getName
();
AbstractSpan
span
=
ContextManager
.
createLocalSpan
(
operationName
);
span
.
setComponent
(
ComponentsDefine
.
XXL_JOB
);
Tags
.
LOGIC_ENDPOINT
.
set
(
span
,
Tags
.
VAL_LOCAL_SPAN_AS_LOGIC_ENDPOINT
);
span
.
tag
(
JOB_PARAM
,
jobParam
);
}
@Override
public
Object
afterMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Object
ret
)
throws
Throwable
{
ContextManager
.
stopSpan
();
return
ret
;
}
@Override
public
void
handleMethodException
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Throwable
t
)
{
ContextManager
.
activeSpan
().
log
(
t
);
}
}
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xxljob/define/MethodJobHandlerInstrumentation.java
0 → 100644
浏览文件 @
e200ef10
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.plugin.xxljob.define
;
import
net.bytebuddy.description.method.MethodDescription
;
import
net.bytebuddy.matcher.ElementMatcher
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
java.lang.reflect.Method
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
isPublic
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArgument
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArguments
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
match
.
NameMatch
.
byName
;
import
static
org
.
apache
.
skywalking
.
apm
.
plugin
.
xxljob
.
Constants
.
XXL_METHOD_JOB_HANDLER
;
/**
* Enhance {@link com.xxl.job.core.handler.impl.MethodJobHandler} instance and intercept {@link com.xxl.job.core.handler.impl.MethodJobHandler#execute(String)} method,
* this method is a entrance of execute method job.
*
* @see org.apache.skywalking.apm.plugin.xxljob.MethodJobHandlerConstructorInterceptor
* @see org.apache.skywalking.apm.plugin.xxljob.MethodJobHandlerMethodInterceptor
*/
public
class
MethodJobHandlerInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
public
static
final
String
CONSTRUCTOR_INTERCEPTOR_CLASS
=
"org.apache.skywalking.apm.plugin.xxljob.MethodJobHandlerConstructorInterceptor"
;
public
static
final
String
METHOD_INTERCEPTOR_CLASS
=
"org.apache.skywalking.apm.plugin.xxljob.MethodJobHandlerMethodInterceptor"
;
@Override
protected
ClassMatch
enhanceClass
()
{
return
byName
(
XXL_METHOD_JOB_HANDLER
);
}
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[]
{
new
ConstructorInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getConstructorMatcher
()
{
return
takesArguments
(
4
)
.
and
(
takesArgument
(
0
,
Object
.
class
))
.
and
(
takesArgument
(
1
,
Method
.
class
))
.
and
(
takesArgument
(
2
,
Method
.
class
))
.
and
(
takesArgument
(
3
,
Method
.
class
));
}
@Override
public
String
getConstructorInterceptor
()
{
return
CONSTRUCTOR_INTERCEPTOR_CLASS
;
}
}
};
}
@Override
public
InstanceMethodsInterceptPoint
[]
getInstanceMethodsInterceptPoints
()
{
return
new
InstanceMethodsInterceptPoint
[]
{
new
InstanceMethodsInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getMethodsMatcher
()
{
return
named
(
"execute"
)
.
and
(
isPublic
())
.
and
(
takesArguments
(
1
))
.
and
(
takesArgument
(
0
,
String
.
class
));
}
@Override
public
String
getMethodsInterceptor
()
{
return
METHOD_INTERCEPTOR_CLASS
;
}
@Override
public
boolean
isOverrideArgs
()
{
return
false
;
}
}
};
}
}
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xxljob/define/ScriptJobHandlerInstrumentation.java
0 → 100644
浏览文件 @
e200ef10
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.plugin.xxljob.define
;
import
net.bytebuddy.description.method.MethodDescription
;
import
net.bytebuddy.matcher.ElementMatcher
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
isPublic
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArgument
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArguments
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
match
.
NameMatch
.
byName
;
import
static
org
.
apache
.
skywalking
.
apm
.
plugin
.
xxljob
.
Constants
.
XXL_SCRIPT_JOB_HANDLER
;
/**
* Enhance {@link com.xxl.job.core.handler.impl.ScriptJobHandler} instance and intercept {@link com.xxl.job.core.handler.impl.ScriptJobHandler#execute(String)} method,
* this method is a entrance of execute script job.
*
* @see org.apache.skywalking.apm.plugin.xxljob.ScriptJobHandlerConstructorInterceptor
* @see org.apache.skywalking.apm.plugin.xxljob.ScriptJobHandlerMethodInterceptor
*/
public
class
ScriptJobHandlerInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
public
static
final
String
CONSTRUCTOR_INTERCEPTOR_CLASS
=
"org.apache.skywalking.apm.plugin.xxljob.ScriptJobHandlerConstructorInterceptor"
;
public
static
final
String
METHOD_INTERCEPTOR_CLASS
=
"org.apache.skywalking.apm.plugin.xxljob.ScriptJobHandlerMethodInterceptor"
;
@Override
protected
ClassMatch
enhanceClass
()
{
return
byName
(
XXL_SCRIPT_JOB_HANDLER
);
}
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[]
{
new
ConstructorInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getConstructorMatcher
()
{
return
takesArguments
(
4
);
}
@Override
public
String
getConstructorInterceptor
()
{
return
CONSTRUCTOR_INTERCEPTOR_CLASS
;
}
}
};
}
@Override
public
InstanceMethodsInterceptPoint
[]
getInstanceMethodsInterceptPoints
()
{
return
new
InstanceMethodsInterceptPoint
[]
{
new
InstanceMethodsInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getMethodsMatcher
()
{
return
named
(
"execute"
)
.
and
(
isPublic
())
.
and
(
takesArguments
(
1
))
.
and
(
takesArgument
(
0
,
String
.
class
));
}
@Override
public
String
getMethodsInterceptor
()
{
return
METHOD_INTERCEPTOR_CLASS
;
}
@Override
public
boolean
isOverrideArgs
()
{
return
false
;
}
}
};
}
}
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xxljob/define/SimpleJobHandlerInstrumentation.java
0 → 100644
浏览文件 @
e200ef10
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.plugin.xxljob.define
;
import
net.bytebuddy.description.method.MethodDescription
;
import
net.bytebuddy.matcher.ElementMatcher
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
org.apache.skywalking.apm.agent.core.plugin.match.HierarchyMatch
;
import
org.apache.skywalking.apm.agent.core.plugin.match.IndirectMatch
;
import
org.apache.skywalking.apm.agent.core.plugin.match.MultiClassNameMatch
;
import
org.apache.skywalking.apm.agent.core.plugin.match.logical.LogicalMatchOperation
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
isPublic
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArgument
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArguments
;
import
static
org
.
apache
.
skywalking
.
apm
.
plugin
.
xxljob
.
Constants
.
XXL_IJOB_HANDLER
;
import
static
org
.
apache
.
skywalking
.
apm
.
plugin
.
xxljob
.
Constants
.
XXL_SCRIPT_JOB_HANDLER
;
import
static
org
.
apache
.
skywalking
.
apm
.
plugin
.
xxljob
.
Constants
.
XXL_GLUE_JOB_HANDLER
;
import
static
org
.
apache
.
skywalking
.
apm
.
plugin
.
xxljob
.
Constants
.
XXL_METHOD_JOB_HANDLER
;
/**
* Enhance the implement class of {@link com.xxl.job.core.handler.IJobHandler} and intercept execute(String) method,
* this method is a entrance of execute job.
*
* @see org.apache.skywalking.apm.plugin.xxljob.SimpleJobHandlerMethodInterceptor
*/
public
class
SimpleJobHandlerInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
public
static
final
String
METHOD_INTERCEPTOR_CLASS
=
"org.apache.skywalking.apm.plugin.xxljob.SimpleJobHandlerMethodInterceptor"
;
@Override
protected
ClassMatch
enhanceClass
()
{
IndirectMatch
excludeClass
=
LogicalMatchOperation
.
not
(
MultiClassNameMatch
.
byMultiClassMatch
(
XXL_SCRIPT_JOB_HANDLER
,
XXL_GLUE_JOB_HANDLER
,
XXL_METHOD_JOB_HANDLER
));
IndirectMatch
parentType
=
HierarchyMatch
.
byHierarchyMatch
(
XXL_IJOB_HANDLER
);
return
LogicalMatchOperation
.
and
(
parentType
,
excludeClass
);
}
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[
0
];
}
@Override
public
InstanceMethodsInterceptPoint
[]
getInstanceMethodsInterceptPoints
()
{
return
new
InstanceMethodsInterceptPoint
[]
{
new
InstanceMethodsInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getMethodsMatcher
()
{
return
named
(
"execute"
)
.
and
(
isPublic
())
.
and
(
takesArguments
(
1
))
.
and
(
takesArgument
(
0
,
String
.
class
));
}
@Override
public
String
getMethodsInterceptor
()
{
return
METHOD_INTERCEPTOR_CLASS
;
}
@Override
public
boolean
isOverrideArgs
()
{
return
false
;
}
}
};
}
}
apm-sniffer/apm-sdk-plugin/xxl-job-2.x-plugin/src/main/resources/skywalking-plugin.def
0 → 100644
浏览文件 @
e200ef10
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
xxl-job-2.x=org.apache.skywalking.apm.plugin.xxljob.define.SimpleJobHandlerInstrumentation
xxl-job-2.x=org.apache.skywalking.apm.plugin.xxljob.define.ScriptJobHandlerInstrumentation
xxl-job-2.x=org.apache.skywalking.apm.plugin.xxljob.define.MethodJobHandlerInstrumentation
\ No newline at end of file
docs/en/setup/service-agent/java-agent/Plugin-list.md
浏览文件 @
e200ef10
...
...
@@ -102,4 +102,5 @@
-
toolkit-exception
-
undertow-2.x-plugin
-
vertx-core-3.x
-
xxl-job-2.x
-
zookeeper-3.4.x
\ No newline at end of file
docs/en/setup/service-agent/java-agent/Supported-list.md
浏览文件 @
e200ef10
...
...
@@ -87,6 +87,7 @@
*
[
Apache ShardingSphere-Elasticjob
](
https://github.com/apache/shardingsphere-elasticjob
)
3.0.0-alpha
*
[
Spring @Scheduled
](
https://github.com/spring-projects/spring-framework
)
3.1+
*
[
Quartz Scheduler
](
https://github.com/quartz-scheduler/quartz
)
2.x (Optional²)
*
[
XXL Job
](
https://github.com/xuxueli/xxl-job
)
2.x
*
OpenTracing community supported
*
[
Canal: Alibaba mysql database binlog incremental subscription & consumer components
](
https://github.com/alibaba/canal
)
1.0.25 -> 1.1.2
*
JSON
...
...
oap-server/server-bootstrap/src/main/resources/component-libraries.yml
浏览文件 @
e200ef10
...
...
@@ -323,6 +323,9 @@ SpringScheduled:
quartz-scheduler
:
id
:
97
languages
:
Java
xxl-job
:
id
:
98
languages
:
Java
# .NET/.NET Core components
# [3000, 4000) for C#/.NET only
...
...
oap-server/server-core/src/test/resources/component-libraries.yml
浏览文件 @
e200ef10
...
...
@@ -272,6 +272,9 @@ SpringScheduled:
quartz-scheduler
:
id
:
97
languages
:
Java
xxl-job
:
id
:
98
languages
:
Java
# .NET/.NET Core components
# [3000, 4000) for C#/.NET only
...
...
test/plugin/scenarios/xxl-job-2.x-scenario/bin/startup.sh
0 → 100644
浏览文件 @
e200ef10
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
home
=
"
$(
cd
"
$(
dirname
$0
)
"
;
pwd
)
"
java
-jar
${
agent_opts
}
${
home
}
/../libs/xxl-job-2.x-scenario.jar &
\ No newline at end of file
test/plugin/scenarios/xxl-job-2.x-scenario/config/expectedData.yaml
0 → 100644
浏览文件 @
e200ef10
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
segmentItems
:
-
serviceName
:
xxl-job-2.x-scenario
segmentSize
:
ge
7
segments
:
-
segmentId
:
not
null
spans
:
-
operationName
:
/xxl-job-2.x-scenario/case/simpleJob
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
1
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/xxl-job-2.x-scenario/case/simpleJob'
}
-
{
key
:
http.method
,
value
:
GET
}
refs
:
-
{
parentEndpoint
:
xxl-job/SimpleJob/test.org.apache.skywalking.apm.testcase.xxljob.job.BeanJob
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
not null
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/xxl-job-2.x-scenario/case/simpleJob
operationId
:
0
parentSpanId
:
0
spanId
:
1
spanLayer
:
Http
startTime
:
not
null
endTime
:
not
null
componentId
:
12
isError
:
false
spanType
:
Exit
peer
:
localhost:8080
skipAnalysis
:
false
tags
:
-
{
key
:
http.method
,
value
:
GET
}
-
{
key
:
url
,
value
:
'
http://localhost:8080/xxl-job-2.x-scenario/case/simpleJob'
}
-
operationName
:
xxl-job/SimpleJob/test.org.apache.skywalking.apm.testcase.xxljob.job.BeanJob
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Unknown
startTime
:
not
null
endTime
:
not
null
componentId
:
98
isError
:
false
spanType
:
Local
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
x-le
,
value
:
'
{"logic-span":true}'
}
-
{
key
:
jobParam
,
value
:
'
k=1'
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/xxl-job-2.x-scenario/case/methodJob
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
1
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/xxl-job-2.x-scenario/case/methodJob'
}
-
{
key
:
http.method
,
value
:
GET
}
refs
:
-
{
parentEndpoint
:
xxl-job/MethodJob/org.apache.skywalking.apm.testcase.xxljob.job.MethodJob.work
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
not null
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/xxl-job-2.x-scenario/case/methodJob
operationId
:
0
parentSpanId
:
0
spanId
:
1
spanLayer
:
Http
startTime
:
not
null
endTime
:
not
null
componentId
:
12
isError
:
false
spanType
:
Exit
peer
:
localhost:8080
skipAnalysis
:
false
tags
:
-
{
key
:
http.method
,
value
:
GET
}
-
{
key
:
url
,
value
:
'
http://localhost:8080/xxl-job-2.x-scenario/case/methodJob'
}
-
operationName
:
xxl-job/MethodJob/org.apache.skywalking.apm.testcase.xxljob.job.MethodJob.work
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Unknown
startTime
:
not
null
endTime
:
not
null
componentId
:
98
isError
:
false
spanType
:
Local
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
x-le
,
value
:
'
{"logic-span":true}'
}
-
{
key
:
jobParam
,
value
:
'
k=2'
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/xxl-job-2.x-scenario/case/glueJob
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
1
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/xxl-job-2.x-scenario/case/glueJob'
}
-
{
key
:
http.method
,
value
:
GET
}
refs
:
-
{
parentEndpoint
:
xxl-job/SimpleJob/com.xxl.job.service.handler.GlueJob
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
not null
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/xxl-job-2.x-scenario/case/glueJob
operationId
:
0
parentSpanId
:
0
spanId
:
1
spanLayer
:
Http
startTime
:
not
null
endTime
:
not
null
componentId
:
12
isError
:
false
spanType
:
Exit
peer
:
localhost:8080
skipAnalysis
:
false
tags
:
-
{
key
:
http.method
,
value
:
GET
}
-
{
key
:
url
,
value
:
'
http://localhost:8080/xxl-job-2.x-scenario/case/glueJob'
}
-
operationName
:
xxl-job/SimpleJob/com.xxl.job.service.handler.GlueJob
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Unknown
startTime
:
not
null
endTime
:
not
null
componentId
:
98
isError
:
false
spanType
:
Local
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
x-le
,
value
:
'
{"logic-span":true}'
}
-
{
key
:
jobParam
,
value
:
'
k=3'
}
-
segmentId
:
not
null
spans
:
-
operationName
:
xxl-job/ScriptJob/GLUE_SHELL/id/4
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Unknown
startTime
:
not
null
endTime
:
not
null
componentId
:
98
isError
:
false
spanType
:
Local
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
x-le
,
value
:
'
{"logic-span":true}'
}
-
{
key
:
jobParam
,
value
:
'
k=4'
}
\ No newline at end of file
test/plugin/scenarios/xxl-job-2.x-scenario/configuration.yml
0 → 100644
浏览文件 @
e200ef10
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
type
:
jvm
entryService
:
http://localhost:8080/xxl-job-2.x-scenario/case/call
healthCheck
:
http://localhost:8080/xxl-job-2.x-scenario/case/healthCheck
startScript
:
./bin/startup.sh
environment
:
-
MYSQL_ADDRESS=mysql-server:3306
-
MYSQL_ROOT_PASSWORD=123456
-
XXL_JOB_SERVER=http://xxl-job-server:8080/xxl-job-admin
depends_on
:
-
mysql-server
-
xxl-job-server
dependencies
:
mysql-server
:
image
:
mysql:5.7
hostname
:
mysql-server
environment
:
-
MYSQL_ROOT_PASSWORD=123456
xxl-job-server
:
image
:
xuxueli/xxl-job-admin:2.2.0
hostname
:
xxl-job-server
environment
:
-
PARAMS=--spring.datasource.url=jdbc:mysql://mysql-server:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai --spring.datasource.username=root --spring.datasource.password=123456
depends_on
:
-
mysql-server
\ No newline at end of file
test/plugin/scenarios/xxl-job-2.x-scenario/pom.xml
0 → 100644
浏览文件 @
e200ef10
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<groupId>
org.apache.skywalking.apm.testcase
</groupId>
<artifactId>
xxl-job-2.x-scenario
</artifactId>
<version>
1.0.0
</version>
<packaging>
jar
</packaging>
<modelVersion>
4.0.0
</modelVersion>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<compiler.version>
1.8
</compiler.version>
<!-- Cannot be auto testing xxl-job (2.0.0 ~ 2.1.2) because the xxl-job server incompatible -->
<test.framework.version>
2.2.0
</test.framework.version>
<spring-boot-version>
2.1.6.RELEASE
</spring-boot-version>
<lombok.version>
1.18.10
</lombok.version>
</properties>
<name>
skywalking-xxl-job-2.x-scenario
</name>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-dependencies
</artifactId>
<version>
${spring-boot-version}
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>
net.bytebuddy
</groupId>
<artifactId>
byte-buddy
</artifactId>
<version>
1.10.14
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<exclusions>
<exclusion>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-logging
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-log4j2
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-jdbc
</artifactId>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<version>
${lombok.version}
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
com.xuxueli
</groupId>
<artifactId>
xxl-job-core
</artifactId>
<version>
${test.framework.version}
</version>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<version>
5.1.25
</version>
</dependency>
<dependency>
<groupId>
com.squareup.okhttp3
</groupId>
<artifactId>
okhttp
</artifactId>
<version>
3.0.0
</version>
</dependency>
</dependencies>
<build>
<finalName>
xxl-job-2.x-scenario
</finalName>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<executions>
<execution>
<goals>
<goal>
repackage
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>
maven-compiler-plugin
</artifactId>
<configuration>
<source>
${compiler.version}
</source>
<target>
${compiler.version}
</target>
<encoding>
${project.build.sourceEncoding}
</encoding>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-assembly-plugin
</artifactId>
<executions>
<execution>
<id>
assemble
</id>
<phase>
package
</phase>
<goals>
<goal>
single
</goal>
</goals>
<configuration>
<descriptors>
<descriptor>
src/main/assembly/assembly.xml
</descriptor>
</descriptors>
<outputDirectory>
./target/
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/assembly/assembly.xml
0 → 100644
浏览文件 @
e200ef10
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<assembly
xmlns=
"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"
>
<formats>
<format>
zip
</format>
</formats>
<fileSets>
<fileSet>
<directory>
./bin
</directory>
<fileMode>
0775
</fileMode>
</fileSet>
</fileSets>
<files>
<file>
<source>
${project.build.directory}/xxl-job-2.x-scenario.jar
</source>
<outputDirectory>
./libs
</outputDirectory>
<fileMode>
0775
</fileMode>
</file>
</files>
</assembly>
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/xxljob/Application.java
0 → 100644
浏览文件 @
e200ef10
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.testcase.xxljob
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@EnableAutoConfiguration
@SpringBootApplication
public
class
Application
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
Application
.
class
,
args
);
}
}
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/xxljob/Utils.java
0 → 100644
浏览文件 @
e200ef10
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.testcase.xxljob
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
okhttp3.MediaType
;
import
okhttp3.OkHttpClient
;
public
class
Utils
{
public
static
final
OkHttpClient
OK_CLIENT
=
new
OkHttpClient
.
Builder
().
build
();
public
static
final
ObjectMapper
JSON
=
new
ObjectMapper
();
public
static
final
MediaType
FORM_DATA
=
MediaType
.
parse
(
"application/x-www-form-urlencoded; charset=UTF-8"
);
}
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/xxljob/controller/CaseController.java
0 → 100644
浏览文件 @
e200ef10
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.testcase.xxljob.controller
;
import
lombok.extern.log4j.Log4j2
;
import
org.apache.skywalking.apm.testcase.xxljob.service.XXLJobServerControlService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"/case"
)
@Log4j2
public
class
CaseController
{
private
static
final
String
SUCCESS
=
"Success"
;
@Autowired
private
XXLJobServerControlService
xxlJobServerControlService
;
@RequestMapping
(
"/simpleJob"
)
@ResponseBody
public
String
simpleJob
()
{
return
SUCCESS
;
}
@RequestMapping
(
"/methodJob"
)
@ResponseBody
public
String
methodJob
()
{
return
SUCCESS
;
}
@RequestMapping
(
"/glueJob"
)
@ResponseBody
public
String
glueJob
()
{
return
SUCCESS
;
}
@RequestMapping
(
"/healthCheck"
)
@ResponseBody
public
String
healthCheck
()
throws
Exception
{
xxlJobServerControlService
.
checkCurrentExecutorRegistered
();
return
SUCCESS
;
}
@RequestMapping
(
"/call"
)
@ResponseBody
public
String
call
()
{
return
SUCCESS
;
}
}
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/xxljob/job/MethodJob.java
0 → 100644
浏览文件 @
e200ef10
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.testcase.xxljob.job
;
import
com.xxl.job.core.biz.model.ReturnT
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
lombok.extern.slf4j.Slf4j
;
import
okhttp3.Request
;
import
okhttp3.Response
;
import
org.apache.skywalking.apm.testcase.xxljob.Utils
;
import
org.springframework.stereotype.Component
;
import
java.io.IOException
;
@Slf4j
@Component
public
class
MethodJob
{
@XxlJob
(
"MethodJobHandler"
)
public
ReturnT
<
String
>
work
(
String
param
)
throws
IOException
{
log
.
info
(
"MethodJobHandler execute. param: {}"
,
param
);
Request
request
=
new
Request
.
Builder
().
url
(
"http://localhost:8080/xxl-job-2.x-scenario/case/methodJob"
).
build
();
Response
response
=
Utils
.
OK_CLIENT
.
newCall
(
request
).
execute
();
response
.
body
().
close
();
return
ReturnT
.
SUCCESS
;
}
}
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/xxljob/job/XXLJobConfig.java
0 → 100644
浏览文件 @
e200ef10
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.testcase.xxljob.job
;
import
com.xxl.job.core.executor.XxlJobExecutor
;
import
com.xxl.job.core.executor.impl.XxlJobSpringExecutor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
test.org.apache.skywalking.apm.testcase.xxljob.job.BeanJob
;
@Slf4j
@Configuration
public
class
XXLJobConfig
{
@Value
(
"${xxl.job.admin.addresses}"
)
private
String
adminAddresses
;
@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.accessToken}"
)
private
String
accessToken
;
@Value
(
"${xxl.job.executor.logpath}"
)
private
String
logPath
;
@Bean
(
initMethod
=
"start"
,
destroyMethod
=
"destroy"
)
public
XxlJobExecutor
xxlJobExecutor
()
{
log
.
info
(
">>>>>>>>>>> xxl-job config init."
);
XxlJobSpringExecutor
xxlJobExecutor
=
new
XxlJobSpringExecutor
();
xxlJobExecutor
.
setAdminAddresses
(
adminAddresses
);
xxlJobExecutor
.
setIp
(
ip
);
xxlJobExecutor
.
setPort
(
port
);
xxlJobExecutor
.
setAccessToken
(
accessToken
);
xxlJobExecutor
.
setLogPath
(
logPath
);
xxlJobExecutor
.
setAppname
(
appName
);
XxlJobExecutor
.
registJobHandler
(
"BeanJobHandler"
,
new
BeanJob
());
return
xxlJobExecutor
;
}
}
\ No newline at end of file
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/xxljob/job/XXLJobInitializer.java
0 → 100644
浏览文件 @
e200ef10
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.testcase.xxljob.job
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.jdbc.datasource.init.ScriptUtils
;
import
org.springframework.stereotype.Component
;
import
java.sql.Connection
;
import
java.sql.DriverManager
;
@Slf4j
@Component
public
class
XXLJobInitializer
implements
InitializingBean
{
@Value
(
"${xxl.mysql.address}"
)
private
String
mysqlAddress
;
@Value
(
"${xxl.mysql.root_password}"
)
private
String
mysqlRootPassword
;
@Override
public
void
afterPropertiesSet
()
throws
Exception
{
log
.
info
(
"Initializer xxl-job"
);
initDatabase
();
}
private
void
initDatabase
()
throws
Exception
{
Class
.
forName
(
"com.mysql.jdbc.Driver"
);
String
url
=
String
.
format
(
"jdbc:mysql://%s"
,
mysqlAddress
);
try
(
Connection
conn
=
DriverManager
.
getConnection
(
url
,
"root"
,
mysqlRootPassword
))
{
ClassPathResource
classPathResource
=
new
ClassPathResource
(
"tables_xxl_job.sql"
);
ScriptUtils
.
executeSqlScript
(
conn
,
classPathResource
);
}
}
}
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/xxljob/service/XXLJobServerControlService.java
0 → 100644
浏览文件 @
e200ef10
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.testcase.xxljob.service
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
lombok.Getter
;
import
lombok.Setter
;
import
okhttp3.Request
;
import
okhttp3.RequestBody
;
import
okhttp3.Response
;
import
org.apache.skywalking.apm.testcase.xxljob.Utils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
@Service
public
class
XXLJobServerControlService
{
@Value
(
"${xxl.job.admin.addresses}"
)
private
String
xxlJobAdminAddresses
;
@Value
(
"${xxl.job.executor.appname}"
)
private
String
appName
;
private
String
cookie
;
private
void
login
()
throws
Exception
{
Request
request
=
new
Request
.
Builder
()
.
url
(
String
.
format
(
"%s/login"
,
xxlJobAdminAddresses
))
.
method
(
"POST"
,
RequestBody
.
create
(
Utils
.
FORM_DATA
,
"userName=admin&password=123456"
))
.
build
();
Response
response
=
Utils
.
OK_CLIENT
.
newCall
(
request
).
execute
();
if
(
response
.
isSuccessful
())
{
JobResult
result
=
Utils
.
JSON
.
readValue
(
response
.
body
().
byteStream
(),
JobResult
.
class
);
if
(
result
.
getCode
()
==
200
)
{
this
.
cookie
=
response
.
headers
().
get
(
"Set-Cookie"
);
return
;
}
}
throw
new
IllegalStateException
(
"xxl-job login error!"
);
}
public
void
checkCurrentExecutorRegistered
()
throws
Exception
{
login
();
Request
request
=
new
Request
.
Builder
()
.
url
(
String
.
format
(
"%s/jobgroup/pageList"
,
xxlJobAdminAddresses
))
.
method
(
"POST"
,
RequestBody
.
create
(
Utils
.
FORM_DATA
,
String
.
format
(
"appname=%s"
,
appName
)))
.
header
(
"Cookie"
,
cookie
)
.
build
();
Response
response
=
Utils
.
OK_CLIENT
.
newCall
(
request
).
execute
();
if
(
response
.
isSuccessful
())
{
JobGroup
jobGroup
=
Utils
.
JSON
.
readValue
(
response
.
body
().
byteStream
(),
JobGroup
.
class
);
JobGroupData
[]
jobGroupDatas
=
jobGroup
.
getData
();
if
(
jobGroupDatas
!=
null
&&
jobGroupDatas
.
length
==
1
)
{
JobGroupData
jobGroupData
=
jobGroupDatas
[
0
];
if
(!
StringUtils
.
isEmpty
(
jobGroupData
.
getAddressList
())
&&
jobGroupData
.
getRegistryList
()
!=
null
&&
jobGroupData
.
getRegistryList
().
length
>
0
)
{
return
;
}
}
}
throw
new
IllegalStateException
(
"current executor unregistered"
);
}
@Getter
@Setter
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
private
static
class
JobResult
{
@JsonProperty
private
int
code
;
}
@Getter
@Setter
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
private
static
class
JobGroup
{
@JsonProperty
private
JobGroupData
[]
data
;
}
@Getter
@Setter
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
private
static
class
JobGroupData
{
@JsonProperty
private
int
id
;
@JsonProperty
private
String
appname
;
@JsonProperty
private
String
addressList
;
@JsonProperty
private
String
[]
registryList
;
}
}
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/xxljob/job/BeanJob.java
0 → 100644
浏览文件 @
e200ef10
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
test.org.apache.skywalking.apm.testcase.xxljob.job
;
import
com.xxl.job.core.biz.model.ReturnT
;
import
com.xxl.job.core.handler.IJobHandler
;
import
lombok.extern.slf4j.Slf4j
;
import
okhttp3.Request
;
import
okhttp3.Response
;
import
org.apache.skywalking.apm.testcase.xxljob.Utils
;
@Slf4j
public
class
BeanJob
extends
IJobHandler
{
@Override
public
ReturnT
<
String
>
execute
(
String
param
)
throws
Exception
{
log
.
info
(
"BeanJobHandler execute. param: {}"
,
param
);
Request
request
=
new
Request
.
Builder
().
url
(
"http://localhost:8080/xxl-job-2.x-scenario/case/simpleJob"
).
build
();
Response
response
=
Utils
.
OK_CLIENT
.
newCall
(
request
).
execute
();
response
.
body
().
close
();
return
new
ReturnT
<
String
>(
"Success"
);
}
}
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/resources/application.yaml
0 → 100644
浏览文件 @
e200ef10
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
server
:
port
:
8080
servlet
:
context-path
:
/xxl-job-2.x-scenario
logging
:
config
:
classpath:log4j2.xml
xxl
:
mysql
:
address
:
${MYSQL_ADDRESS}
root_password
:
${MYSQL_ROOT_PASSWORD}
job
:
accessToken
:
admin
:
addresses
:
${XXL_JOB_SERVER}
executor
:
ip
:
port
:
9999
logpath
:
/data/applogs/xxl-job/jobhandler
appname
:
xxl-job-executor-demo
\ No newline at end of file
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/resources/log4j2.xml
0 → 100644
浏览文件 @
e200ef10
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<Configuration
status=
"WARN"
>
<Appenders>
<Console
name=
"Console"
target=
"SYSTEM_ERR"
>
<PatternLayout
charset=
"UTF-8"
pattern=
"[%d{yyyy-MM-dd HH:mm:ss:SSS}] [%p] - %l - %m%n"
/>
</Console>
</Appenders>
<Loggers>
<Root
level=
"INFO"
>
<AppenderRef
ref=
"Console"
/>
</Root>
</Loggers>
</Configuration>
\ No newline at end of file
test/plugin/scenarios/xxl-job-2.x-scenario/src/main/resources/tables_xxl_job.sql
0 → 100644
浏览文件 @
e200ef10
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
CREATE
database
if
NOT
EXISTS
`xxl_job`
default
character
set
utf8mb4
collate
utf8mb4_unicode_ci
;
use
`xxl_job`
;
SET
NAMES
utf8mb4
;
CREATE
TABLE
if
NOT
EXISTS
`xxl_job_info`
(
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
`job_group`
int
(
11
)
NOT
NULL
,
`job_cron`
varchar
(
128
)
NOT
NULL
,
`job_desc`
varchar
(
255
)
NOT
NULL
,
`add_time`
datetime
DEFAULT
NULL
,
`update_time`
datetime
DEFAULT
NULL
,
`author`
varchar
(
64
)
DEFAULT
NULL
,
`alarm_email`
varchar
(
255
)
DEFAULT
NULL
,
`executor_route_strategy`
varchar
(
50
)
DEFAULT
NULL
,
`executor_handler`
varchar
(
255
)
DEFAULT
NULL
,
`executor_param`
varchar
(
512
)
DEFAULT
NULL
,
`executor_block_strategy`
varchar
(
50
)
DEFAULT
NULL
,
`executor_timeout`
int
(
11
)
NOT
NULL
DEFAULT
'0'
,
`executor_fail_retry_count`
int
(
11
)
NOT
NULL
DEFAULT
'0'
,
`glue_type`
varchar
(
50
)
NOT
NULL
,
`glue_source`
mediumtext
,
`glue_remark`
varchar
(
128
)
DEFAULT
NULL
,
`glue_updatetime`
datetime
DEFAULT
NULL
,
`child_jobid`
varchar
(
255
)
DEFAULT
NULL
,
`trigger_status`
tinyint
(
4
)
NOT
NULL
DEFAULT
'0'
,
`trigger_last_time`
bigint
(
13
)
NOT
NULL
DEFAULT
'0'
,
`trigger_next_time`
bigint
(
13
)
NOT
NULL
DEFAULT
'0'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
CREATE
TABLE
if
NOT
EXISTS
`xxl_job_log`
(
`id`
bigint
(
20
)
NOT
NULL
AUTO_INCREMENT
,
`job_group`
int
(
11
)
NOT
NULL
,
`job_id`
int
(
11
)
NOT
NULL
,
`executor_address`
varchar
(
255
)
DEFAULT
NULL
,
`executor_handler`
varchar
(
255
)
DEFAULT
NULL
,
`executor_param`
varchar
(
512
)
DEFAULT
NULL
,
`executor_sharding_param`
varchar
(
20
)
DEFAULT
NULL
,
`executor_fail_retry_count`
int
(
11
)
NOT
NULL
DEFAULT
'0'
,
`trigger_time`
datetime
DEFAULT
NULL
,
`trigger_code`
int
(
11
)
NOT
NULL
,
`trigger_msg`
text
,
`handle_time`
datetime
DEFAULT
NULL
,
`handle_code`
int
(
11
)
NOT
NULL
,
`handle_msg`
text
,
`alarm_status`
tinyint
(
4
)
NOT
NULL
DEFAULT
'0'
,
PRIMARY
KEY
(
`id`
),
KEY
`I_trigger_time`
(
`trigger_time`
),
KEY
`I_handle_code`
(
`handle_code`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
CREATE
TABLE
if
NOT
EXISTS
`xxl_job_log_report`
(
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
`trigger_day`
datetime
DEFAULT
NULL
,
`running_count`
int
(
11
)
NOT
NULL
DEFAULT
'0'
,
`suc_count`
int
(
11
)
NOT
NULL
DEFAULT
'0'
,
`fail_count`
int
(
11
)
NOT
NULL
DEFAULT
'0'
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`i_trigger_day`
(
`trigger_day`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
CREATE
TABLE
if
NOT
EXISTS
`xxl_job_logglue`
(
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
`job_id`
int
(
11
)
NOT
NULL
,
`glue_type`
varchar
(
50
)
DEFAULT
NULL
,
`glue_source`
mediumtext
,
`glue_remark`
varchar
(
128
)
NOT
NULL
,
`add_time`
datetime
DEFAULT
NULL
,
`update_time`
datetime
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
CREATE
TABLE
if
NOT
EXISTS
`xxl_job_registry`
(
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
`registry_group`
varchar
(
50
)
NOT
NULL
,
`registry_key`
varchar
(
255
)
NOT
NULL
,
`registry_value`
varchar
(
255
)
NOT
NULL
,
`update_time`
datetime
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
),
KEY
`i_g_k_v`
(
`registry_group`
,
`registry_key`
,
`registry_value`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
CREATE
TABLE
if
NOT
EXISTS
`xxl_job_group`
(
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
`app_name`
varchar
(
64
)
NOT
NULL
,
`title`
varchar
(
12
)
NOT
NULL
,
`address_type`
tinyint
(
4
)
NOT
NULL
DEFAULT
'0'
,
`address_list`
varchar
(
512
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
CREATE
TABLE
if
NOT
EXISTS
`xxl_job_user`
(
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
`username`
varchar
(
50
)
NOT
NULL
,
`password`
varchar
(
50
)
NOT
NULL
,
`role`
tinyint
(
4
)
NOT
NULL
,
`permission`
varchar
(
255
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`i_username`
(
`username`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
CREATE
TABLE
if
NOT
EXISTS
`xxl_job_lock`
(
`lock_name`
varchar
(
50
)
NOT
NULL
,
PRIMARY
KEY
(
`lock_name`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
INSERT
INTO
`xxl_job_group`
(
`id`
,
`app_name`
,
`title`
,
`address_type`
,
`address_list`
)
VALUES
(
1
,
'xxl-job-executor-demo'
,
'my-executor'
,
0
,
NULL
);
INSERT
INTO
`xxl_job`
.
`xxl_job_info`
(
`id`
,
`job_group`
,
`job_cron`
,
`job_desc`
,
`add_time`
,
`update_time`
,
`author`
,
`alarm_email`
,
`executor_route_strategy`
,
`executor_handler`
,
`executor_param`
,
`executor_block_strategy`
,
`executor_timeout`
,
`executor_fail_retry_count`
,
`glue_type`
,
`glue_source`
,
`glue_remark`
,
`glue_updatetime`
,
`child_jobid`
,
`trigger_status`
,
`trigger_last_time`
,
`trigger_next_time`
)
VALUES
(
1
,
1
,
'0/1 * * * * ?'
,
'demo-bean-job'
,
'2020-09-09 23:32:46'
,
'2020-09-11 22:01:15'
,
'XXL'
,
''
,
'FIRST'
,
'BeanJobHandler'
,
'k=1'
,
'SERIAL_EXECUTION'
,
0
,
0
,
'BEAN'
,
''
,
'init'
,
'2018-11-03 22:21:31'
,
''
,
1
,
0
,
0
);
INSERT
INTO
`xxl_job`
.
`xxl_job_info`
(
`id`
,
`job_group`
,
`job_cron`
,
`job_desc`
,
`add_time`
,
`update_time`
,
`author`
,
`alarm_email`
,
`executor_route_strategy`
,
`executor_handler`
,
`executor_param`
,
`executor_block_strategy`
,
`executor_timeout`
,
`executor_fail_retry_count`
,
`glue_type`
,
`glue_source`
,
`glue_remark`
,
`glue_updatetime`
,
`child_jobid`
,
`trigger_status`
,
`trigger_last_time`
,
`trigger_next_time`
)
VALUES
(
2
,
1
,
'0/1 * * * * ?'
,
'demo-method-job'
,
'2020-09-09 23:32:46'
,
'2020-09-11 22:01:12'
,
'XXL'
,
''
,
'FIRST'
,
'MethodJobHandler'
,
'k=2'
,
'SERIAL_EXECUTION'
,
0
,
0
,
'BEAN'
,
''
,
'init'
,
'2020-09-09 23:32:46'
,
''
,
1
,
0
,
0
);
INSERT
INTO
`xxl_job`
.
`xxl_job_info`
(
`id`
,
`job_group`
,
`job_cron`
,
`job_desc`
,
`add_time`
,
`update_time`
,
`author`
,
`alarm_email`
,
`executor_route_strategy`
,
`executor_handler`
,
`executor_param`
,
`executor_block_strategy`
,
`executor_timeout`
,
`executor_fail_retry_count`
,
`glue_type`
,
`glue_source`
,
`glue_remark`
,
`glue_updatetime`
,
`child_jobid`
,
`trigger_status`
,
`trigger_last_time`
,
`trigger_next_time`
)
VALUES
(
3
,
1
,
'0/1 * * * * ?'
,
'demo-glue-java-job'
,
'2020-09-09 23:51:06'
,
'2020-09-11 22:17:25'
,
'XXL'
,
''
,
'FIRST'
,
''
,
'k=3'
,
'SERIAL_EXECUTION'
,
0
,
0
,
'GLUE_GROOVY'
,
'package com.xxl.job.service.handler;
\n\n
import com.xxl.job.core.log.XxlJobLogger;
\n
import com.xxl.job.core.biz.model.ReturnT;
\n
import com.xxl.job.core.handler.IJobHandler;
\n
import okhttp3.OkHttpClient;
\n
import okhttp3.Request;
\n
import okhttp3.Response;
\n
import org.slf4j.Logger;
\n
import org.slf4j.LoggerFactory;
\n\n
public class GlueJob extends IJobHandler {
\n\n
private static final Logger log = LoggerFactory.getLogger(GlueJob.class);
\n\n
private static final OkHttpClient client = new OkHttpClient.Builder().build();
\n\n
@Override
\n
public ReturnT<String> execute(String param) throws Exception {
\n\n
log.info(
\"
GlueJob execute. param: {}
\"
, param);
\n\n
Request request = new Request.Builder().url(
\"
http://localhost:8080/xxl-job-2.x-scenario/case/glueJob
\"
).build();
\n
Response response = client.newCall(request).execute();
\n
response.body().close();
\n\n
return ReturnT.SUCCESS;
\n
}
\n
}
\n
'
,
'init'
,
'2020-09-11 22:17:25'
,
''
,
1
,
0
,
0
);
INSERT
INTO
`xxl_job`
.
`xxl_job_info`
(
`id`
,
`job_group`
,
`job_cron`
,
`job_desc`
,
`add_time`
,
`update_time`
,
`author`
,
`alarm_email`
,
`executor_route_strategy`
,
`executor_handler`
,
`executor_param`
,
`executor_block_strategy`
,
`executor_timeout`
,
`executor_fail_retry_count`
,
`glue_type`
,
`glue_source`
,
`glue_remark`
,
`glue_updatetime`
,
`child_jobid`
,
`trigger_status`
,
`trigger_last_time`
,
`trigger_next_time`
)
VALUES
(
4
,
1
,
'0/1 * * * * ?'
,
'demo-glue-shell-job'
,
'2020-09-09 23:53:32'
,
'2020-09-11 22:01:04'
,
'XXL'
,
''
,
'FIRST'
,
''
,
'k=4'
,
'SERIAL_EXECUTION'
,
0
,
0
,
'GLUE_SHELL'
,
'#!/bin/bash
\n
echo
\"
xxl-job: hello shell
\"\n\n
echo
\"
Good bye!
\"\n
exit 0
\n
'
,
'init'
,
'2020-09-09 23:54:57'
,
''
,
1
,
0
,
0
);
INSERT
INTO
`xxl_job_user`
(
`id`
,
`username`
,
`password`
,
`role`
,
`permission`
)
VALUES
(
1
,
'admin'
,
'e10adc3949ba59abbe56e057f20f883e'
,
1
,
NULL
);
INSERT
INTO
`xxl_job_lock`
(
`lock_name`
)
VALUES
(
'schedule_lock'
);
\ No newline at end of file
test/plugin/scenarios/xxl-job-2.x-scenario/support-version.list
0 → 100644
浏览文件 @
e200ef10
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# lists your version here
2.2.0
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录