Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
SkyWalking
提交
01b4ae5c
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,发现更多精彩内容 >>
提交
01b4ae5c
编写于
11月 19, 2015
作者:
Z
zhangxin10
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成对Dubbox的埋点的测试
上级
321cc60c
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
424 addition
and
201 deletion
+424
-201
skywalking-sdk-plugin/dubbo-plugin/pom.xml
skywalking-sdk-plugin/dubbo-plugin/pom.xml
+122
-115
skywalking-sdk-plugin/dubbo-plugin/src/main/java/com/ai/cloud/skywalking/plugin/dubbo/SWDubboEnhanceFilter.java
...i/cloud/skywalking/plugin/dubbo/SWDubboEnhanceFilter.java
+42
-6
skywalking-sdk-plugin/dubbo-plugin/src/main/java/com/ai/cloud/skywalking/plugin/dubbox/bugfix/below283/BugFixAcitve.java
...kywalking/plugin/dubbox/bugfix/below283/BugFixAcitve.java
+9
-0
skywalking-sdk-plugin/dubbo-plugin/src/main/java/com/ai/cloud/skywalking/plugin/dubbox/bugfix/below283/SWBaseBean.java
.../skywalking/plugin/dubbox/bugfix/below283/SWBaseBean.java
+15
-0
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox/rest/consumer/DubboxRestConsumer.java
.../plugin/test/dubbox/rest/consumer/DubboxRestConsumer.java
+0
-60
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox/rest/impl/DubboxRestInterAImpl.java
...ng/plugin/test/dubbox/rest/impl/DubboxRestInterAImpl.java
+0
-12
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox283/consumer/DubboxRestConsumer.java
...ng/plugin/test/dubbox283/consumer/DubboxRestConsumer.java
+24
-0
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox283/consumer/DubboxRestStart.java
...lking/plugin/test/dubbox283/consumer/DubboxRestStart.java
+4
-2
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox283/impl/DubboxRestInterAImpl.java
...king/plugin/test/dubbox283/impl/DubboxRestInterAImpl.java
+13
-0
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox283/interfaces/IDubboxRestInterA.java
...g/plugin/test/dubbox283/interfaces/IDubboxRestInterA.java
+20
-0
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox283/interfaces/param/DubboxRestInterAParameter.java
...dubbox283/interfaces/param/DubboxRestInterAParameter.java
+34
-0
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox284/consumer/DubboxRestConsumer.java
...ng/plugin/test/dubbox284/consumer/DubboxRestConsumer.java
+22
-0
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox284/consumer/DubboxRestStart.java
...lking/plugin/test/dubbox284/consumer/DubboxRestStart.java
+19
-0
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox284/impl/DubboxRestInterAImpl.java
...king/plugin/test/dubbox284/impl/DubboxRestInterAImpl.java
+13
-0
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox284/interfaces/IDubboxRestInterA.java
...g/plugin/test/dubbox284/interfaces/IDubboxRestInterA.java
+4
-2
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox284/interfaces/param/DubboxRestInterAParameter.java
...dubbox284/interfaces/param/DubboxRestInterAParameter.java
+32
-0
skywalking-sdk-plugin/dubbo-plugin/src/test/resources/consumer/dubbo-consumer.xml
...bbo-plugin/src/test/resources/consumer/dubbo-consumer.xml
+2
-1
skywalking-sdk-plugin/dubbo-plugin/src/test/resources/consumer/dubbox283-consumer.xml
...plugin/src/test/resources/consumer/dubbox283-consumer.xml
+14
-0
skywalking-sdk-plugin/dubbo-plugin/src/test/resources/consumer/dubbox284-consumer.xml
...plugin/src/test/resources/consumer/dubbox284-consumer.xml
+15
-0
skywalking-sdk-plugin/dubbo-plugin/src/test/resources/provider/dubbox283-provider.xml
...plugin/src/test/resources/provider/dubbox283-provider.xml
+4
-3
skywalking-sdk-plugin/dubbo-plugin/src/test/resources/provider/dubbox284-provider.xml
...plugin/src/test/resources/provider/dubbox284-provider.xml
+16
-0
未找到文件。
skywalking-sdk-plugin/dubbo-plugin/pom.xml
浏览文件 @
01b4ae5c
<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>
skywalking-sdk-plugin
</artifactId>
<groupId>
com.ai.cloud
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
skywalking-sdk-plugin
</artifactId>
<groupId>
com.ai.cloud
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
dubbo-plugin
</artifactId>
<packaging>
jar
</packaging>
<artifactId>
dubbo-plugin
</artifactId>
<packaging>
jar
</packaging>
<name>
spring-plugin
</name>
<url>
http://maven.apache.org
</url>
<name>
spring-plugin
</name>
<url>
http://maven.apache.org
</url>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>
Company nexus
</id>
<url>
http://223.202.119.155
:18081/nexus/content/groups/public/
</url>
</repository>
</repositories>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>
Company nexus
</id>
<url>
http://10.1.228.199
:18081/nexus/content/groups/public/
</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>
com.ai.cloud
</groupId>
<artifactId>
skywalking-api
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
com.ai.cloud
</groupId>
<artifactId>
skywalking-auth
</artifactId>
<version>
${project.version}
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
com.ai.cloud
</groupId>
<artifactId>
skywalking-api
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-context
</artifactId>
<version>
3.0.0.RELEASE
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.jboss.resteasy
</groupId>
<artifactId>
resteasy-jaxrs
</artifactId>
<version>
3.0.7.Final
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.jboss.resteasy
</groupId>
<artifactId>
resteasy-client
</artifactId>
<version>
3.0.7.Final
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
javax.validation
</groupId>
<artifactId>
validation-api
</artifactId>
<version>
1.0.0.GA
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.jboss.resteasy
</groupId>
<artifactId>
resteasy-jackson-provider
</artifactId>
<version>
3.0.7.Final
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.apache.tomcat.embed
</groupId>
<artifactId>
tomcat-embed-core
</artifactId>
<version>
8.0.11
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.apache.tomcat.embed
</groupId>
<artifactId>
tomcat-embed-logging-juli
</artifactId>
<version>
8.0.11
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
javax.ws.rs
</groupId>
<artifactId>
javax.ws.rs-api
</artifactId>
<version>
2.0
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
log4j
</groupId>
<artifactId>
log4j
</artifactId>
<version>
1.2.17
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
com.101tec
</groupId>
<artifactId>
zkclient
</artifactId>
<version>
0.7
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
dubbox
</artifactId>
<version>
2.8.3
</version>
</dependency>
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<artifactId>
httpclient
</artifactId>
<version>
4.5.1
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
dubbo
</artifactId>
<version>
2.5.3
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>
com.ai.cloud
</groupId>
<artifactId>
skywalking-api
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
com.ai.cloud
</groupId>
<artifactId>
skywalking-auth
</artifactId>
<version>
${project.version}
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
com.ai.cloud
</groupId>
<artifactId>
skywalking-api
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-context
</artifactId>
<version>
3.0.0.RELEASE
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.jboss.resteasy
</groupId>
<artifactId>
resteasy-jaxrs
</artifactId>
<version>
3.0.7.Final
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.jboss.resteasy
</groupId>
<artifactId>
resteasy-client
</artifactId>
<version>
3.0.7.Final
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
javax.validation
</groupId>
<artifactId>
validation-api
</artifactId>
<version>
1.0.0.GA
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.jboss.resteasy
</groupId>
<artifactId>
resteasy-jackson-provider
</artifactId>
<version>
3.0.7.Final
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.apache.tomcat.embed
</groupId>
<artifactId>
tomcat-embed-core
</artifactId>
<version>
8.0.11
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.apache.tomcat.embed
</groupId>
<artifactId>
tomcat-embed-logging-juli
</artifactId>
<version>
8.0.11
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
javax.ws.rs
</groupId>
<artifactId>
javax.ws.rs-api
</artifactId>
<version>
2.0
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
log4j
</groupId>
<artifactId>
log4j
</artifactId>
<version>
1.2.17
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
com.101tec
</groupId>
<artifactId>
zkclient
</artifactId>
<version>
0.7
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
dubbox
</artifactId>
<version>
2.8.3
</version>
<scope>
compile
</scope>
</dependency>
<!--<dependency>-->
<!--<groupId>com.alibaba</groupId>-->
<!--<artifactId>dubbox</artifactId>-->
<!--<version>2.8.4</version>-->
<!--<scope>compile</scope>-->
<!--</dependency>-->
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<artifactId>
httpclient
</artifactId>
<version>
4.2.1
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.javassist
</groupId>
<artifactId>
javassist
</artifactId>
<version>
3.20.0-GA
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
</project>
skywalking-sdk-plugin/dubbo-plugin/src/main/java/com/ai/cloud/skywalking/plugin/dubbo/SWDubboEnhanceFilter.java
浏览文件 @
01b4ae5c
...
...
@@ -4,6 +4,8 @@ import com.ai.cloud.skywalking.buriedpoint.RPCBuriedPointReceiver;
import
com.ai.cloud.skywalking.buriedpoint.RPCBuriedPointSender
;
import
com.ai.cloud.skywalking.model.ContextData
;
import
com.ai.cloud.skywalking.model.Identification
;
import
com.ai.cloud.skywalking.plugin.dubbox.bugfix.below283.BugFixAcitve
;
import
com.ai.cloud.skywalking.plugin.dubbox.bugfix.below283.SWBaseBean
;
import
com.alibaba.dubbo.common.extension.Activate
;
import
com.alibaba.dubbo.rpc.*
;
...
...
@@ -16,10 +18,17 @@ public class SWDubboEnhanceFilter implements Filter {
Result
result
=
null
;
if
(
isConsumer
)
{
RPCBuriedPointSender
sender
=
new
RPCBuriedPointSender
();
ContextData
contextData
=
sender
.
beforeSend
(
createIdentification
(
invoker
,
invocation
));
// 追加参数
RpcInvocation
rpcInvocation
=
(
RpcInvocation
)
invocation
;
rpcInvocation
.
setAttachment
(
"contextData"
,
contextData
.
toString
());
String
contextDataStr
=
contextData
.
toString
();
//追加参数
if
(!
BugFixAcitve
.
isActive
)
{
context
.
setAttachment
(
"contextData"
,
contextDataStr
);
}
else
{
fix283SendNoAttachmentIssue
(
invocation
,
contextDataStr
);
}
try
{
//执行结果
result
=
invoker
.
invoke
(
invocation
);
...
...
@@ -37,8 +46,14 @@ public class SWDubboEnhanceFilter implements Filter {
}
else
{
// 读取参数
RPCBuriedPointReceiver
rpcBuriedPointReceiver
=
new
RPCBuriedPointReceiver
();
RpcInvocation
rpcInvocation
=
(
RpcInvocation
)
invocation
;
String
contextDataStr
=
rpcInvocation
.
getAttachment
(
"contextData"
);
String
contextDataStr
;
if
(!
BugFixAcitve
.
isActive
)
{
contextDataStr
=
context
.
getAttachment
(
"contextData"
);
}
else
{
contextDataStr
=
fix283RecvNoAttachmentIssue
(
invocation
);
}
ContextData
contextData
=
null
;
if
(
contextDataStr
!=
null
&&
contextDataStr
.
length
()
>
0
)
{
contextData
=
new
ContextData
(
contextDataStr
);
...
...
@@ -83,4 +98,25 @@ public class SWDubboEnhanceFilter implements Filter {
viewPoint
.
append
(
")"
);
return
Identification
.
newBuilder
().
viewPoint
(
viewPoint
.
toString
()).
spanType
(
'D'
).
build
();
}
}
private
static
void
fix283SendNoAttachmentIssue
(
Invocation
invocation
,
String
contextDataStr
)
{
for
(
Object
parameter
:
invocation
.
getArguments
())
{
if
(
parameter
instanceof
SWBaseBean
)
{
((
SWBaseBean
)
parameter
).
setContextData
(
contextDataStr
);
return
;
}
}
}
private
static
String
fix283RecvNoAttachmentIssue
(
Invocation
invocation
)
{
for
(
Object
parameter
:
invocation
.
getArguments
())
{
if
(
parameter
instanceof
SWBaseBean
)
{
return
((
SWBaseBean
)
parameter
).
getContextData
();
}
}
return
null
;
}
}
\ No newline at end of file
skywalking-sdk-plugin/dubbo-plugin/src/main/java/com/ai/cloud/skywalking/plugin/dubbox/bugfix/below283/BugFixAcitve.java
0 → 100644
浏览文件 @
01b4ae5c
package
com.ai.cloud.skywalking.plugin.dubbox.bugfix.below283
;
public
final
class
BugFixAcitve
{
public
static
boolean
isActive
=
false
;
public
BugFixAcitve
(){
isActive
=
true
;
}
}
skywalking-sdk-plugin/dubbo-plugin/src/main/java/com/ai/cloud/skywalking/plugin/dubbox/bugfix/below283/SWBaseBean.java
0 → 100644
浏览文件 @
01b4ae5c
package
com.ai.cloud.skywalking.plugin.dubbox.bugfix.below283
;
import
java.io.Serializable
;
public
class
SWBaseBean
implements
Serializable
{
private
String
contextData
;
public
String
getContextData
()
{
return
contextData
;
}
public
void
setContextData
(
String
contextData
)
{
this
.
contextData
=
contextData
;
}
}
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox/rest/consumer/DubboxRestConsumer.java
已删除
100644 → 0
浏览文件 @
321cc60c
package
com.ai.cloud.skywalking.plugin.test.dubbox.rest.consumer
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.HttpPost
;
import
org.apache.http.entity.ContentType
;
import
org.apache.http.entity.StringEntity
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.HttpClients
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.net.URISyntaxException
;
import
java.net.URL
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
DubboxRestConsumer
{
private
static
final
Log
logger
=
LogFactory
.
getLog
(
DubboxRestConsumer
.
class
);
public
static
String
sendPostRequest
(
String
url
,
String
data
,
Map
<
String
,
String
>
header
)
throws
IOException
,
URISyntaxException
{
CloseableHttpClient
httpclient
=
HttpClients
.
createDefault
();
HttpPost
httpPost
=
new
HttpPost
(
new
URL
(
url
).
toURI
());
for
(
Map
.
Entry
<
String
,
String
>
entry
:
header
.
entrySet
())
{
httpPost
.
setHeader
(
entry
.
getKey
(),
entry
.
getValue
());
}
StringEntity
dataEntity
=
new
StringEntity
(
data
,
ContentType
.
APPLICATION_JSON
);
httpPost
.
setEntity
(
dataEntity
);
CloseableHttpResponse
response
=
httpclient
.
execute
(
httpPost
);
try
{
if
(
response
.
getStatusLine
().
getStatusCode
()
==
200
)
{
HttpEntity
entity
=
response
.
getEntity
();
BufferedReader
reader
=
new
BufferedReader
(
new
InputStreamReader
(
entity
.
getContent
()));
StringBuffer
buffer
=
new
StringBuffer
();
String
tempStr
;
while
((
tempStr
=
reader
.
readLine
())
!=
null
)
buffer
.
append
(
tempStr
);
return
buffer
.
toString
();
}
else
{
throw
new
RuntimeException
(
"error code "
+
response
.
getStatusLine
().
getStatusCode
()
+
":"
+
response
.
getStatusLine
().
getReasonPhrase
());
}
}
finally
{
response
.
close
();
httpclient
.
close
();
}
}
public
static
void
main
(
String
[]
args
)
throws
IOException
,
URISyntaxException
{
String
url
=
"http://192.168.1.102:20880/skywalking/rest-a/doBusiness"
;
String
data
=
"{\"paramA\":\"BBBB\"}"
;
sendPostRequest
(
url
,
data
,
new
HashMap
<
String
,
String
>());
}
}
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox/rest/impl/DubboxRestInterAImpl.java
已删除
100644 → 0
浏览文件 @
321cc60c
package
com.ai.cloud.skywalking.plugin.test.dubbox.rest.impl
;
import
com.ai.cloud.skywalking.plugin.test.dubbox.rest.interfaces.IDubboxRestInterA
;
import
com.alibaba.dubbo.config.annotation.Service
;
@Service
public
class
DubboxRestInterAImpl
implements
IDubboxRestInterA
{
public
String
doBusiness
(
String
paramA
)
{
System
.
out
.
println
(
"param : "
+
paramA
);
return
"{\"content\":\""
+
paramA
+
"\"}"
;
}
}
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox283/consumer/DubboxRestConsumer.java
0 → 100644
浏览文件 @
01b4ae5c
package
com.ai.cloud.skywalking.plugin.test.dubbox283.consumer
;
import
com.ai.cloud.skywalking.plugin.dubbox.bugfix.below283.BugFixAcitve
;
import
com.ai.cloud.skywalking.plugin.test.dubbox283.interfaces.IDubboxRestInterA
;
import
com.ai.cloud.skywalking.plugin.test.dubbox283.interfaces.param.DubboxRestInterAParameter
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.support.ClassPathXmlApplicationContext
;
import
java.io.IOException
;
import
java.net.URISyntaxException
;
public
class
DubboxRestConsumer
{
private
static
final
Log
logger
=
LogFactory
.
getLog
(
DubboxRestConsumer
.
class
);
public
static
void
main
(
String
[]
args
)
throws
IOException
,
URISyntaxException
,
InterruptedException
{
new
BugFixAcitve
();
ApplicationContext
context
=
new
ClassPathXmlApplicationContext
(
"classpath*:consumer/dubbox283-consumer.xml"
);
IDubboxRestInterA
dubboxRestInterA
=
context
.
getBean
(
IDubboxRestInterA
.
class
);
dubboxRestInterA
.
doBusiness
(
new
DubboxRestInterAParameter
(
"AAAAA"
));
Thread
.
sleep
(
10000000L
);
}
}
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox
/rest/impl
/DubboxRestStart.java
→
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox
283/consumer
/DubboxRestStart.java
浏览文件 @
01b4ae5c
package
com.ai.cloud.skywalking.plugin.test.dubbox
.rest.impl
;
package
com.ai.cloud.skywalking.plugin.test.dubbox
283.consumer
;
import
com.ai.cloud.skywalking.plugin.dubbox.bugfix.below283.BugFixAcitve
;
import
org.springframework.context.support.ClassPathXmlApplicationContext
;
public
class
DubboxRestStart
{
public
static
void
main
(
String
[]
args
)
throws
InterruptedException
{
new
BugFixAcitve
();
ClassPathXmlApplicationContext
classPathXmlApplicationContext
=
new
ClassPathXmlApplicationContext
(
"classpath*:provider/dubbox-provider.xml"
);
ClassPathXmlApplicationContext
(
"classpath*:provider/dubbox
283
-provider.xml"
);
classPathXmlApplicationContext
.
start
();
...
...
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox283/impl/DubboxRestInterAImpl.java
0 → 100644
浏览文件 @
01b4ae5c
package
com.ai.cloud.skywalking.plugin.test.dubbox283.impl
;
import
com.ai.cloud.skywalking.plugin.test.dubbox283.interfaces.IDubboxRestInterA
;
import
com.ai.cloud.skywalking.plugin.test.dubbox283.interfaces.param.DubboxRestInterAParameter
;
import
com.alibaba.dubbo.config.annotation.Service
;
@Service
public
class
DubboxRestInterAImpl
implements
IDubboxRestInterA
{
public
String
doBusiness
(
DubboxRestInterAParameter
paramA
)
{
System
.
out
.
println
(
"param : "
+
paramA
.
getParameterA
());
return
"{\"content\":\""
+
paramA
.
getParameterA
()
+
"\"}"
;
}
}
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox283/interfaces/IDubboxRestInterA.java
0 → 100644
浏览文件 @
01b4ae5c
package
com.ai.cloud.skywalking.plugin.test.dubbox283.interfaces
;
import
com.ai.cloud.skywalking.plugin.test.dubbox283.impl.DubboxRestInterAImpl
;
import
com.ai.cloud.skywalking.plugin.test.dubbox283.interfaces.param.DubboxRestInterAParameter
;
import
javax.ws.rs.Consumes
;
import
javax.ws.rs.POST
;
import
javax.ws.rs.Path
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.core.MediaType
;
@Path
(
"/rest-a"
)
@Consumes
({
MediaType
.
APPLICATION_JSON
})
@Produces
({
MediaType
.
APPLICATION_JSON
,
MediaType
.
TEXT_XML
})
public
interface
IDubboxRestInterA
{
@Path
(
"/doBusiness"
)
@POST
String
doBusiness
(
DubboxRestInterAParameter
paramA
);
}
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox283/interfaces/param/DubboxRestInterAParameter.java
0 → 100644
浏览文件 @
01b4ae5c
package
com.ai.cloud.skywalking.plugin.test.dubbox283.interfaces.param
;
import
com.ai.cloud.skywalking.plugin.dubbox.bugfix.below283.SWBaseBean
;
import
org.codehaus.jackson.annotate.JsonIgnoreProperties
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlElement
;
import
javax.xml.bind.annotation.XmlRootElement
;
@XmlRootElement
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
DubboxRestInterAParameter
extends
SWBaseBean
{
public
DubboxRestInterAParameter
()
{
}
@XmlElement
(
name
=
"parameterA"
)
private
String
parameterA
;
public
DubboxRestInterAParameter
(
String
parameterA
)
{
this
.
parameterA
=
parameterA
;
}
public
String
getParameterA
()
{
return
parameterA
;
}
public
void
setParameterA
(
String
parameterA
)
{
this
.
parameterA
=
parameterA
;
}
}
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox284/consumer/DubboxRestConsumer.java
0 → 100644
浏览文件 @
01b4ae5c
package
com.ai.cloud.skywalking.plugin.test.dubbox284.consumer
;
import
com.ai.cloud.skywalking.plugin.test.dubbox283.interfaces.param.DubboxRestInterAParameter
;
import
com.ai.cloud.skywalking.plugin.test.dubbox284.interfaces.IDubboxRestInterA
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.support.ClassPathXmlApplicationContext
;
import
java.io.IOException
;
import
java.net.URISyntaxException
;
public
class
DubboxRestConsumer
{
private
static
final
Log
logger
=
LogFactory
.
getLog
(
DubboxRestConsumer
.
class
);
public
static
void
main
(
String
[]
args
)
throws
IOException
,
URISyntaxException
,
InterruptedException
{
ApplicationContext
context
=
new
ClassPathXmlApplicationContext
(
"classpath*:consumer/dubbox284-consumer.xml"
);
IDubboxRestInterA
dubboxRestInterA
=
context
.
getBean
(
IDubboxRestInterA
.
class
);
dubboxRestInterA
.
doBusiness
(
new
DubboxRestInterAParameter
(
"AAAAA"
));
Thread
.
sleep
(
10000000L
);
}
}
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox284/consumer/DubboxRestStart.java
0 → 100644
浏览文件 @
01b4ae5c
package
com.ai.cloud.skywalking.plugin.test.dubbox284.consumer
;
import
com.ai.cloud.skywalking.plugin.dubbox.bugfix.below283.BugFixAcitve
;
import
org.springframework.context.support.ClassPathXmlApplicationContext
;
public
class
DubboxRestStart
{
public
static
void
main
(
String
[]
args
)
throws
InterruptedException
{
new
BugFixAcitve
();
ClassPathXmlApplicationContext
classPathXmlApplicationContext
=
new
ClassPathXmlApplicationContext
(
"classpath*:provider/dubbox284-provider.xml"
);
classPathXmlApplicationContext
.
start
();
while
(
true
)
{
Thread
.
sleep
(
100000L
);
}
}
}
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox284/impl/DubboxRestInterAImpl.java
0 → 100644
浏览文件 @
01b4ae5c
package
com.ai.cloud.skywalking.plugin.test.dubbox284.impl
;
import
com.ai.cloud.skywalking.plugin.test.dubbox283.interfaces.param.DubboxRestInterAParameter
;
import
com.ai.cloud.skywalking.plugin.test.dubbox284.interfaces.IDubboxRestInterA
;
import
com.alibaba.dubbo.config.annotation.Service
;
@Service
public
class
DubboxRestInterAImpl
implements
IDubboxRestInterA
{
public
String
doBusiness
(
DubboxRestInterAParameter
paramA
)
{
System
.
out
.
println
(
"param : "
+
paramA
.
getParameterA
());
return
"{\"content\":\""
+
paramA
.
getParameterA
()
+
"\"}"
;
}
}
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox
/rest
/interfaces/IDubboxRestInterA.java
→
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox
284
/interfaces/IDubboxRestInterA.java
浏览文件 @
01b4ae5c
package
com.ai.cloud.skywalking.plugin.test.dubbox.rest.interfaces
;
package
com.ai.cloud.skywalking.plugin.test.dubbox284.interfaces
;
import
com.ai.cloud.skywalking.plugin.test.dubbox283.interfaces.param.DubboxRestInterAParameter
;
import
javax.ws.rs.Consumes
;
import
javax.ws.rs.POST
;
...
...
@@ -13,5 +15,5 @@ public interface IDubboxRestInterA {
@Path
(
"/doBusiness"
)
@POST
String
doBusiness
(
String
paramA
);
String
doBusiness
(
DubboxRestInterAParameter
paramA
);
}
skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox284/interfaces/param/DubboxRestInterAParameter.java
0 → 100644
浏览文件 @
01b4ae5c
package
com.ai.cloud.skywalking.plugin.test.dubbox284.interfaces.param
;
import
org.codehaus.jackson.annotate.JsonIgnoreProperties
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlElement
;
import
javax.xml.bind.annotation.XmlRootElement
;
@XmlRootElement
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
DubboxRestInterAParameter
{
public
DubboxRestInterAParameter
()
{
}
@XmlElement
(
name
=
"parameterA"
)
private
String
parameterA
;
public
DubboxRestInterAParameter
(
String
parameterA
)
{
this
.
parameterA
=
parameterA
;
}
public
String
getParameterA
()
{
return
parameterA
;
}
public
void
setParameterA
(
String
parameterA
)
{
this
.
parameterA
=
parameterA
;
}
}
skywalking-sdk-plugin/dubbo-plugin/src/test/resources/consumer/dubbo-consumer.xml
浏览文件 @
01b4ae5c
...
...
@@ -8,6 +8,7 @@
<dubbo:application
name=
"skywalking-consumer"
/>
<dubbo:registry
address=
"zookeeper://127.0.0.1:2181"
/>
<dubbo:consumer
filter=
"swEnhanceFilter"
/>
<dubbo:reference
id=
"dubboInterA"
interface=
"com.ai.cloud.skywalking.plugin.test.dubbo.interfaces.IDubboInterA"
/>
<dubbo:reference
id=
"dubboInterA"
interface=
"com.ai.cloud.skywalking.plugin.test.dubbo.interfaces.IDubboInterA"
url=
"dubbo://192.168.1.108:20880"
/>
</beans>
\ No newline at end of file
skywalking-sdk-plugin/dubbo-plugin/src/test/resources/consumer/dubbox283-consumer.xml
0 → 100644
浏览文件 @
01b4ae5c
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:dubbo=
"http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd"
>
<dubbo:application
name=
"skywalking-consumer"
/>
<dubbo:registry
address=
"zookeeper://127.0.0.1:2181"
/>
<dubbo:consumer
filter=
"swEnhanceFilter"
/>
<dubbo:reference
id=
"dubboxRestInterA"
interface=
"com.ai.cloud.skywalking.plugin.test.dubbox283.interfaces.IDubboxRestInterA"
url=
"rest://192.168.1.108:20880"
/>
</beans>
\ No newline at end of file
skywalking-sdk-plugin/dubbo-plugin/src/test/resources/consumer/dubbox284-consumer.xml
0 → 100644
浏览文件 @
01b4ae5c
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:dubbo=
"http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd"
>
<dubbo:application
name=
"skywalking-consumer"
/>
<dubbo:registry
address=
"zookeeper://127.0.0.1:2181"
/>
<dubbo:consumer
filter=
"swEnhanceFilter"
/>
<dubbo:reference
id=
"dubboxRestInterA"
interface=
"com.ai.cloud.skywalking.plugin.test.dubbox284.interfaces.IDubboxRestInterA"
url=
"rest://192.168.1.108:20880"
/>
</beans>
\ No newline at end of file
skywalking-sdk-plugin/dubbo-plugin/src/test/resources/provider/dubbox-provider.xml
→
skywalking-sdk-plugin/dubbo-plugin/src/test/resources/provider/dubbox
283
-provider.xml
浏览文件 @
01b4ae5c
...
...
@@ -7,9 +7,10 @@
<dubbo:application
name=
"skywalking-dubbo-rest-provider"
/>
<dubbo:registry
address=
"zookeeper://127.0.0.1:2181"
/>
<dubbo:protocol
name=
"rest"
port=
"20880"
server=
"tomcat"
contextpath=
"skywalking"
/>
<dubbo:protocol
name=
"rest"
port=
"20880"
server=
"tomcat"
/>
<dubbo:provider
filter=
"swEnhanceFilter"
/>
<bean
id=
"dubboxRestInterA"
class=
"com.ai.cloud.skywalking.plugin.test.dubbox.rest.impl.DubboxRestInterAImpl"
/>
<dubbo:service
interface=
"com.ai.cloud.skywalking.plugin.test.dubbox.rest.interfaces.IDubboxRestInterA"
ref=
"dubboxRestInterA"
/>
<bean
id=
"dubboxRestInterA"
class=
"com.ai.cloud.skywalking.plugin.test.dubbox283.impl.DubboxRestInterAImpl"
/>
<dubbo:service
interface=
"com.ai.cloud.skywalking.plugin.test.dubbox283.interfaces.IDubboxRestInterA"
ref=
"dubboxRestInterA"
/>
</beans>
\ No newline at end of file
skywalking-sdk-plugin/dubbo-plugin/src/test/resources/provider/dubbox284-provider.xml
0 → 100644
浏览文件 @
01b4ae5c
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:dubbo=
"http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd"
>
<dubbo:application
name=
"skywalking-dubbo-rest-provider"
/>
<dubbo:registry
address=
"zookeeper://127.0.0.1:2181"
/>
<dubbo:protocol
name=
"rest"
port=
"20880"
server=
"tomcat"
/>
<dubbo:provider
filter=
"swEnhanceFilter"
/>
<bean
id=
"dubboxRestInterA"
class=
"com.ai.cloud.skywalking.plugin.test.dubbox284.impl.DubboxRestInterAImpl"
/>
<dubbo:service
interface=
"com.ai.cloud.skywalking.plugin.test.dubbox284.interfaces.IDubboxRestInterA"
ref=
"dubboxRestInterA"
/>
</beans>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录