This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-java.git
The following commit(s) were added to refs/heads/main by this push:
new 6baa4a7baa Add support for RESTEasy 6.x (#587)
6baa4a7baa is described below
commit 6baa4a7baae13bd67d8e0579a87dc5429a4fdf26
Author: Leibniz.Hu <[email protected]>
AuthorDate: Thu Jul 27 22:18:05 2023 +0800
Add support for RESTEasy 6.x (#587)
---
.github/workflows/plugins-jdk17-test.1.yaml | 1 +
CHANGES.md | 1 +
apm-sniffer/apm-sdk-plugin/resteasy-plugin/pom.xml | 1 +
.../{ => resteasy-server-6.x-plugin}/pom.xml | 29 +--
.../SynchronousDispatcherExceptionInterceptor.java | 52 ++++++
.../server/SynchronousDispatcherInterceptor.java | 93 ++++++++++
.../SynchronousDispatcherInstrumentation.java | 86 +++++++++
.../src/main/resources/skywalking-plugin.def | 10 +-
.../apm/plugin/resteasy/v6/server/AssertTools.java | 47 +++++
.../SynchronousDispatcherInterceptorTest.java | 187 +++++++++++++++++++
.../setup/service-agent/java-agent/Plugin-list.md | 1 +
.../service-agent/java-agent/Supported-list.md | 2 +-
.../resteasy-4.x-scenario/support-version.list | 3 +-
.../resteasy-6.x-scenario/config/expectedData.yaml | 200 +++++++++++++++++++++
.../configuration.yml} | 14 +-
.../plugin/scenarios/resteasy-6.x-scenario/pom.xml | 107 +++++++++++
.../apm/testcase/RestTemplateController.java | 73 ++++++++
.../skywalking/apm/testcase/UserApplication.java | 40 +++++
.../skywalking/apm/testcase/UserResource.java | 78 ++++++++
.../skywalking/apm/testcase/entity/User.java | 55 ++++++
.../src/main/resources/log4j2.xml | 30 ++++
.../src/main/webapp/WEB-INF/web.xml | 39 ++++
.../support-version.list | 13 +-
23 files changed, 1120 insertions(+), 42 deletions(-)
diff --git a/.github/workflows/plugins-jdk17-test.1.yaml
b/.github/workflows/plugins-jdk17-test.1.yaml
index d820466d8c..69629116e6 100644
--- a/.github/workflows/plugins-jdk17-test.1.yaml
+++ b/.github/workflows/plugins-jdk17-test.1.yaml
@@ -56,6 +56,7 @@ jobs:
matrix:
case:
- spring-6.x-scenario
+ - resteasy-6.x-scenario
steps:
- uses: actions/checkout@v2
with:
diff --git a/CHANGES.md b/CHANGES.md
index a56bff98cd..06e524ef27 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -148,6 +148,7 @@ Callable {
* Upgrade netty-codec-http2 to 4.1.94.Final
* Upgrade guava to 32.0.1
* Fix issue with duplicate enhancement by ThreadPoolExecutor
+* Add plugin to support for RESTeasy 6.x.
#### Documentation
diff --git a/apm-sniffer/apm-sdk-plugin/resteasy-plugin/pom.xml
b/apm-sniffer/apm-sdk-plugin/resteasy-plugin/pom.xml
index 519d791353..566377c8f3 100644
--- a/apm-sniffer/apm-sdk-plugin/resteasy-plugin/pom.xml
+++ b/apm-sniffer/apm-sdk-plugin/resteasy-plugin/pom.xml
@@ -28,6 +28,7 @@
<modules>
<module>resteasy-server-3.x-plugin</module>
<module>resteasy-server-4.x-plugin</module>
+ <module>resteasy-server-6.x-plugin</module>
</modules>
<packaging>pom</packaging>
diff --git a/apm-sniffer/apm-sdk-plugin/resteasy-plugin/pom.xml
b/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-6.x-plugin/pom.xml
similarity index 62%
copy from apm-sniffer/apm-sdk-plugin/resteasy-plugin/pom.xml
copy to
apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-6.x-plugin/pom.xml
index 519d791353..e7267afaec 100644
--- a/apm-sniffer/apm-sdk-plugin/resteasy-plugin/pom.xml
+++
b/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-6.x-plugin/pom.xml
@@ -16,27 +16,30 @@
~ 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">
+<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">
<modelVersion>4.0.0</modelVersion>
<parent>
+ <artifactId>resteasy-plugin</artifactId>
<groupId>org.apache.skywalking</groupId>
- <artifactId>apm-sdk-plugin</artifactId>
<version>9.0.0-SNAPSHOT</version>
</parent>
- <artifactId>resteasy-plugin</artifactId>
- <modules>
- <module>resteasy-server-3.x-plugin</module>
- <module>resteasy-server-4.x-plugin</module>
- </modules>
+ <artifactId>resteasy-server-6.x-plugin</artifactId>
+ <packaging>jar</packaging>
- <packaging>pom</packaging>
-
- <name>resteasy-plugin</name>
- <url>http://maven.apache.org</url>
+ <name>apm-resteasy-server-6.x-plugin</name>
<properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <sdk.plugin.related.dir>/..</sdk.plugin.related.dir>
+ <resteasy.version>6.2.4.Final</resteasy.version>
</properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-core</artifactId>
+ <version>${resteasy.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
</project>
\ No newline at end of file
diff --git
a/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/resteasy/v6/server/SynchronousDispatcherExceptionInterceptor.java
b/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/resteasy/v6/server/SynchronousDispatcherExceptionInterceptor.java
new file mode 100644
index 0000000000..d368311d48
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/resteasy/v6/server/SynchronousDispatcherExceptionInterceptor.java
@@ -0,0 +1,52 @@
+/*
+ * 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.resteasy.v6.server;
+
+import org.apache.skywalking.apm.agent.core.context.ContextManager;
+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.jboss.resteasy.spi.HttpRequest;
+
+import java.lang.reflect.Method;
+
+public class SynchronousDispatcherExceptionInterceptor implements
InstanceMethodsAroundInterceptor {
+
+ @Override
+ public void beforeMethod(EnhancedInstance objInst, Method method, Object[]
allArguments, Class<?>[] argumentsTypes,
+ MethodInterceptResult result) throws Throwable {
+ if (ContextManager.isActive() && !((HttpRequest)
allArguments[0]).getAsyncContext().isSuspended()) {
+ ContextManager.activeSpan().log((Throwable) allArguments[2]);
+ }
+ }
+
+ @Override
+ public Object afterMethod(EnhancedInstance objInst, Method method,
Object[] allArguments, Class<?>[] argumentsTypes,
+ Object ret) throws Throwable {
+ return ret;
+ }
+
+ @Override
+ public void handleMethodException(EnhancedInstance objInst, Method method,
Object[] allArguments,
+ Class<?>[] argumentsTypes, Throwable t) {
+ if (ContextManager.isActive()) {
+ ContextManager.activeSpan().log(t);
+ }
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/resteasy/v6/server/SynchronousDispatcherInterceptor.java
b/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/resteasy/v6/server/SynchronousDispatcherInterceptor.java
new file mode 100644
index 0000000000..6355b8e295
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/resteasy/v6/server/SynchronousDispatcherInterceptor.java
@@ -0,0 +1,93 @@
+/*
+ * 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.resteasy.v6.server;
+
+import org.apache.skywalking.apm.agent.core.context.CarrierItem;
+import org.apache.skywalking.apm.agent.core.context.ContextCarrier;
+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.context.trace.SpanLayer;
+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 org.jboss.resteasy.spi.HttpRequest;
+import org.jboss.resteasy.spi.HttpResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.lang.reflect.Method;
+
+public class SynchronousDispatcherInterceptor implements
InstanceMethodsAroundInterceptor {
+ private static final Logger LOG =
LoggerFactory.getLogger(SynchronousDispatcherInterceptor.class);
+
+ @Override
+ public void beforeMethod(EnhancedInstance objInst, Method method, Object[]
allArguments, Class<?>[] argumentsTypes,
+ MethodInterceptResult result) throws Throwable {
+ HttpRequest request = (HttpRequest) allArguments[0];
+
+ ContextCarrier contextCarrier = new ContextCarrier();
+ CarrierItem next = contextCarrier.items();
+ while (next.hasNext()) {
+ next = next.next();
+
next.setHeadValue(request.getHttpHeaders().getHeaderString(next.getHeadKey()));
+ }
+
+ String operationName = request.getHttpMethod() + ":" +
request.getUri().getPath();
+ AbstractSpan span = ContextManager.createEntrySpan(operationName,
contextCarrier);
+ span.tag(Tags.URL,
toPath(request.getUri().getRequestUri().toString()));
+ span.tag(Tags.HTTP.METHOD, request.getHttpMethod());
+ span.setComponent(ComponentsDefine.RESTEASY);
+ SpanLayer.asHttp(span);
+ }
+
+ @Override
+ public Object afterMethod(EnhancedInstance objInst, Method method,
Object[] allArguments, Class<?>[] argumentsTypes,
+ Object ret) throws Throwable {
+ if (!ContextManager.isActive()) {
+ return ret;
+ }
+ HttpResponse response = (HttpResponse) allArguments[1];
+ AbstractSpan span = ContextManager.activeSpan();
+ if (response.getStatus() >= 400) {
+ span.errorOccurred();
+ }
+ Tags.HTTP_RESPONSE_STATUS_CODE.set(span, response.getStatus());
+ ContextManager.stopSpan();
+ return ret;
+ }
+
+ @Override
+ public void handleMethodException(EnhancedInstance objInst, Method method,
Object[] allArguments,
+ Class<?>[] argumentsTypes, Throwable t) {
+ if (ContextManager.isActive()) {
+ ContextManager.activeSpan().log(t);
+ }
+ }
+
+ private static String toPath(String uri) {
+ int index = uri.indexOf("?");
+ if (index > -1) {
+ return uri.substring(0, index);
+ } else {
+ return uri;
+ }
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/resteasy/v6/server/define/SynchronousDispatcherInstrumentation.java
b/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/resteasy/v6/server/define/SynchronousDispatcherInstrumentation.java
new file mode 100644
index 0000000000..c4a472487c
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/resteasy/v6/server/define/SynchronousDispatcherInstrumentation.java
@@ -0,0 +1,86 @@
+/*
+ * 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.resteasy.v6.server.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.NameMatch;
+
+import static net.bytebuddy.matcher.ElementMatchers.named;
+import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
+
+public class SynchronousDispatcherInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
+
+ private static final String ENHANCE_CLASS =
"org.jboss.resteasy.core.SynchronousDispatcher";
+
+ private static final String INVOKE_INTERCEPT_CLASS =
"org.apache.skywalking.apm.plugin.resteasy.v6.server.SynchronousDispatcherInterceptor";
+ private static final String INVOKE_EXCEPTION_INTERCEPT_CLASS =
"org.apache.skywalking.apm.plugin.resteasy.v6.server.SynchronousDispatcherExceptionInterceptor";
+
+ @Override
+ public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
+ return null;
+ }
+
+ @Override
+ public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints()
{
+ return new InstanceMethodsInterceptPoint[] {
+ new InstanceMethodsInterceptPoint() {
+ @Override
+ public ElementMatcher<MethodDescription> getMethodsMatcher() {
+ return named("invoke").and(takesArguments(3));
+ }
+
+ @Override
+ public String getMethodsInterceptor() {
+ return INVOKE_INTERCEPT_CLASS;
+ }
+
+ @Override
+ public boolean isOverrideArgs() {
+ return false;
+ }
+ },
+ new InstanceMethodsInterceptPoint() {
+ @Override
+ public ElementMatcher<MethodDescription> getMethodsMatcher() {
+ return named("writeException").and(takesArguments(3));
+ }
+
+ @Override
+ public String getMethodsInterceptor() {
+ return INVOKE_EXCEPTION_INTERCEPT_CLASS;
+ }
+
+ @Override
+ public boolean isOverrideArgs() {
+ return false;
+ }
+ }
+ };
+ }
+
+ @Override
+ protected ClassMatch enhanceClass() {
+ return NameMatch.byName(ENHANCE_CLASS);
+ }
+}
diff --git a/test/plugin/scenarios/resteasy-4.x-scenario/support-version.list
b/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-6.x-plugin/src/main/resources/skywalking-plugin.def
similarity index 83%
copy from test/plugin/scenarios/resteasy-4.x-scenario/support-version.list
copy to
apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-6.x-plugin/src/main/resources/skywalking-plugin.def
index f671bc5b79..f76865da86 100644
--- a/test/plugin/scenarios/resteasy-4.x-scenario/support-version.list
+++
b/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-6.x-plugin/src/main/resources/skywalking-plugin.def
@@ -14,12 +14,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# test all 4.x version, with corresponding latest patch version
-4.7.6.Final
-4.6.2.Final
-4.5.12.Final
-4.4.3.Final
-4.3.1.Final
-4.2.0.Final
-4.1.1.Final
-4.0.0.Final
\ No newline at end of file
+resteasy-server-6.x=org.apache.skywalking.apm.plugin.resteasy.v6.server.define.SynchronousDispatcherInstrumentation
\ No newline at end of file
diff --git
a/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-6.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/resteasy/v6/server/AssertTools.java
b/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-6.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/resteasy/v6/server/AssertTools.java
new file mode 100644
index 0000000000..20fa3eb76e
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-6.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/resteasy/v6/server/AssertTools.java
@@ -0,0 +1,47 @@
+/*
+ * 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.resteasy.v6.server;
+
+import org.apache.skywalking.apm.agent.core.context.trace.AbstractTracingSpan;
+import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer;
+import org.apache.skywalking.apm.agent.core.context.trace.TraceSegmentRef;
+import org.apache.skywalking.apm.agent.test.helper.SegmentRefHelper;
+import org.apache.skywalking.apm.agent.test.tools.SpanAssert;
+import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
+
+import static
org.apache.skywalking.apm.agent.test.tools.SpanAssert.assertComponent;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+class AssertTools {
+
+ static void assertTraceSegmentRef(TraceSegmentRef ref) {
+ assertThat(SegmentRefHelper.getParentServiceInstance(ref),
is("instance"));
+ assertThat(SegmentRefHelper.getSpanId(ref), is(3));
+ assertThat(SegmentRefHelper.getTraceSegmentId(ref).toString(),
is("3.4.5"));
+ }
+
+ static void assertHttpSpan(AbstractTracingSpan span) {
+ assertThat(span.getOperationName(), is("GET:/test/testRequestURL"));
+ assertComponent(span, ComponentsDefine.RESTEASY);
+ SpanAssert.assertTag(span, 0,
"http://localhost:8080/test/testRequestURL");
+ assertThat(span.isEntry(), is(true));
+ SpanAssert.assertLayer(span, SpanLayer.HTTP);
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-6.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/resteasy/v6/server/SynchronousDispatcherInterceptorTest.java
b/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-6.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/resteasy/v6/server/SynchronousDispatcherInterceptorTest.java
new file mode 100644
index 0000000000..a8aef14399
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-6.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/resteasy/v6/server/SynchronousDispatcherInterceptorTest.java
@@ -0,0 +1,187 @@
+/*
+ * 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.resteasy.v6.server;
+
+import org.apache.skywalking.apm.agent.core.context.SW8CarrierItem;
+import org.apache.skywalking.apm.agent.core.context.trace.AbstractTracingSpan;
+import org.apache.skywalking.apm.agent.core.context.trace.LogDataEntity;
+import org.apache.skywalking.apm.agent.core.context.trace.TraceSegment;
+import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
+import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
+import org.apache.skywalking.apm.agent.test.helper.SegmentHelper;
+import org.apache.skywalking.apm.agent.test.helper.SpanHelper;
+import org.apache.skywalking.apm.agent.test.tools.AgentServiceRule;
+import org.apache.skywalking.apm.agent.test.tools.SegmentStorage;
+import org.apache.skywalking.apm.agent.test.tools.SegmentStoragePoint;
+import org.apache.skywalking.apm.agent.test.tools.SpanAssert;
+import org.apache.skywalking.apm.agent.test.tools.TracingSegmentRunner;
+import org.jboss.resteasy.specimpl.MultivaluedMapImpl;
+import org.jboss.resteasy.specimpl.ResteasyHttpHeaders;
+import org.jboss.resteasy.specimpl.ResteasyUriInfo;
+import org.jboss.resteasy.spi.HttpRequest;
+import org.jboss.resteasy.spi.HttpResponse;
+import org.jboss.resteasy.spi.ResourceInvoker;
+import org.jboss.resteasy.spi.ResteasyAsynchronousContext;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnit;
+import org.mockito.junit.MockitoRule;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.List;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.mockito.Mockito.when;
+
+@RunWith(TracingSegmentRunner.class)
+public class SynchronousDispatcherInterceptorTest {
+
+ private SynchronousDispatcherInterceptor synchronousDispatcherInterceptor;
+ private SynchronousDispatcherExceptionInterceptor exceptionInterceptor;
+
+ @SegmentStoragePoint
+ private SegmentStorage segmentStorage;
+
+ @Rule
+ public AgentServiceRule serviceRule = new AgentServiceRule();
+ @Rule
+ public MockitoRule rule = MockitoJUnit.rule();
+
+ @Mock
+ HttpRequest request;
+
+ @Mock
+ HttpResponse response;
+
+ @Mock
+ ResourceInvoker resourceInvoker;
+
+ @Mock
+ private MethodInterceptResult methodInterceptResult;
+
+ @Mock
+ private ResteasyAsynchronousContext resteasyAsynchronousContext;
+
+ @Mock
+ EnhancedInstance enhancedInstance;
+
+ private Object[] arguments;
+ private Class[] argumentType;
+
+ private Object[] exceptionArguments;
+ private Class[] exceptionArgumentType;
+
+ @Before
+ public void setup() throws URISyntaxException {
+ synchronousDispatcherInterceptor = new
SynchronousDispatcherInterceptor();
+ exceptionInterceptor = new SynchronousDispatcherExceptionInterceptor();
+ when(request.getUri()).thenReturn(new ResteasyUriInfo(new
URI("http://localhost:8080/test/testRequestURL")));
+ when(request.getHttpHeaders()).thenReturn(new ResteasyHttpHeaders(new
MultivaluedMapImpl<String, String>()));
+ when(request.getHttpMethod()).thenReturn("GET");
+ when(response.getStatus()).thenReturn(200);
+
when(request.getAsyncContext()).thenReturn(resteasyAsynchronousContext);
+ when(request.getAsyncContext().isSuspended()).thenReturn(false);
+ arguments = new Object[] {
+ request,
+ response,
+ resourceInvoker
+ };
+ argumentType = new Class[] {
+ request.getClass(),
+ response.getClass(),
+ resourceInvoker.getClass()
+ };
+
+ exceptionArguments = new Object[] {
+ request,
+ response,
+ new RuntimeException()
+ };
+ exceptionArgumentType = new Class[] {
+ request.getClass(),
+ response.getClass(),
+ new RuntimeException().getClass()
+ };
+ }
+
+ @Test
+ public void testWithoutSerializedContextData() throws Throwable {
+ synchronousDispatcherInterceptor.beforeMethod(enhancedInstance, null,
arguments, argumentType, methodInterceptResult);
+ synchronousDispatcherInterceptor.afterMethod(enhancedInstance, null,
arguments, argumentType, null);
+
+ assertThat(segmentStorage.getTraceSegments().size(), is(1));
+ TraceSegment traceSegment = segmentStorage.getTraceSegments().get(0);
+ List<AbstractTracingSpan> spans = SegmentHelper.getSpans(traceSegment);
+ AssertTools.assertHttpSpan(spans.get(0));
+ }
+
+ @Test
+ public void testWithSW6SerializedContextData() throws Throwable {
+ MultivaluedMapImpl<String, String> multivaluedMap = new
MultivaluedMapImpl<String, String>();
+ multivaluedMap.putSingle(SW8CarrierItem.HEADER_NAME,
"1-My40LjU=-MS4yLjM=-3-c2VydmljZQ==-aW5zdGFuY2U=-L2FwcA==-MTI3LjAuMC4xOjgwODA=");
+ when(request.getHttpHeaders()).thenReturn(new
ResteasyHttpHeaders(multivaluedMap));
+
+ synchronousDispatcherInterceptor.beforeMethod(enhancedInstance, null,
arguments, argumentType, methodInterceptResult);
+ synchronousDispatcherInterceptor.afterMethod(enhancedInstance, null,
arguments, argumentType, null);
+
+ assertThat(segmentStorage.getTraceSegments().size(), is(1));
+ TraceSegment traceSegment = segmentStorage.getTraceSegments().get(0);
+ List<AbstractTracingSpan> spans = SegmentHelper.getSpans(traceSegment);
+
+ AssertTools.assertHttpSpan(spans.get(0));
+ AssertTools.assertTraceSegmentRef(traceSegment.getRef());
+ }
+
+ @Test
+ public void testWithOccurException() throws Throwable {
+ synchronousDispatcherInterceptor.beforeMethod(enhancedInstance, null,
arguments, argumentType, methodInterceptResult);
+
synchronousDispatcherInterceptor.handleMethodException(enhancedInstance, null,
arguments, argumentType, new RuntimeException());
+ synchronousDispatcherInterceptor.afterMethod(enhancedInstance, null,
arguments, argumentType, null);
+
+ assertThat(segmentStorage.getTraceSegments().size(), is(1));
+ TraceSegment traceSegment = segmentStorage.getTraceSegments().get(0);
+ List<AbstractTracingSpan> spans = SegmentHelper.getSpans(traceSegment);
+
+ AssertTools.assertHttpSpan(spans.get(0));
+ List<LogDataEntity> logDataEntities = SpanHelper.getLogs(spans.get(0));
+ assertThat(logDataEntities.size(), is(1));
+ SpanAssert.assertException(logDataEntities.get(0),
RuntimeException.class);
+ }
+
+ @Test
+ public void testWithMainThreadOccurException() throws Throwable {
+ synchronousDispatcherInterceptor.beforeMethod(enhancedInstance, null,
arguments, argumentType, methodInterceptResult);
+ exceptionInterceptor.beforeMethod(enhancedInstance, null,
exceptionArguments, exceptionArgumentType, null);
+ synchronousDispatcherInterceptor.afterMethod(enhancedInstance, null,
arguments, argumentType, null);
+
+ assertThat(segmentStorage.getTraceSegments().size(), is(1));
+ TraceSegment traceSegment = segmentStorage.getTraceSegments().get(0);
+ List<AbstractTracingSpan> spans = SegmentHelper.getSpans(traceSegment);
+
+ AssertTools.assertHttpSpan(spans.get(0));
+ List<LogDataEntity> logDataEntities = SpanHelper.getLogs(spans.get(0));
+ assertThat(logDataEntities.size(), is(1));
+ SpanAssert.assertException(logDataEntities.get(0),
RuntimeException.class);
+ }
+}
diff --git a/docs/en/setup/service-agent/java-agent/Plugin-list.md
b/docs/en/setup/service-agent/java-agent/Plugin-list.md
index 749539889f..168334e4ea 100644
--- a/docs/en/setup/service-agent/java-agent/Plugin-list.md
+++ b/docs/en/setup/service-agent/java-agent/Plugin-list.md
@@ -82,6 +82,7 @@
- redisson-3.x
- resteasy-server-3.x
- resteasy-server-4.x
+- resteasy-server-6.x
- rocketMQ-3.x
- rocketMQ-4.x
- rocketMQ-5.x
diff --git a/docs/en/setup/service-agent/java-agent/Supported-list.md
b/docs/en/setup/service-agent/java-agent/Supported-list.md
index 3ed5dbf763..c85d653275 100644
--- a/docs/en/setup/service-agent/java-agent/Supported-list.md
+++ b/docs/en/setup/service-agent/java-agent/Supported-list.md
@@ -17,7 +17,7 @@ metrics based on the tracing data.
* [Jetty Server](http://www.eclipse.org/jetty/) 9.x -> 11.x
* [Spring
WebFlux](https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html)
5.x (Optional¹)
* [Undertow](http://undertow.io/) 1.3.0.Final -> 2.0.27.Final
- * [RESTEasy](https://resteasy.github.io/) 3.1.0.Final -> 4.7.6.Final
+ * [RESTEasy](https://resteasy.github.io/) 3.1.0.Final -> 6.2.4.Final
* [Play Framework](https://www.playframework.com/) 2.6.x -> 2.8.x
* [Light4J Microservices Framework](https://doc.networknt.com/) 1.6.x -> 2.x
* [Netty SocketIO](https://github.com/mrniko/netty-socketio) 1.x
diff --git a/test/plugin/scenarios/resteasy-4.x-scenario/support-version.list
b/test/plugin/scenarios/resteasy-4.x-scenario/support-version.list
index f671bc5b79..fd107e871d 100644
--- a/test/plugin/scenarios/resteasy-4.x-scenario/support-version.list
+++ b/test/plugin/scenarios/resteasy-4.x-scenario/support-version.list
@@ -14,7 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# test all 4.x version, with corresponding latest patch version
+# test all 4.x and 5.x version, with corresponding latest patch version
+5.0.7.Final
4.7.6.Final
4.6.2.Final
4.5.12.Final
diff --git
a/test/plugin/scenarios/resteasy-6.x-scenario/config/expectedData.yaml
b/test/plugin/scenarios/resteasy-6.x-scenario/config/expectedData.yaml
new file mode 100644
index 0000000000..bba69c4027
--- /dev/null
+++ b/test/plugin/scenarios/resteasy-6.x-scenario/config/expectedData.yaml
@@ -0,0 +1,200 @@
+# 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: resteasy-6.x-scenario
+ segmentSize: ge 6
+ segments:
+ - segmentId: not null
+ spans:
+ - operationName: HEAD:/resteasy-6.x-scenario/healthCheck
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 1
+ isError: false
+ spanType: Entry
+ peer: ''
+ tags:
+ - { key: url, value:
'http://localhost:8080/resteasy-6.x-scenario/healthCheck' }
+ - { key: http.method, value: HEAD }
+ - { key: http.status_code, value: '200' }
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: POST:/resteasy-6.x-scenario/create/
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 1
+ isError: false
+ spanType: Entry
+ peer: ''
+ tags:
+ - { key: url, value:
'http://localhost:8080/resteasy-6.x-scenario/create/' }
+ - { key: http.method, value: POST }
+ - { key: http.status_code, value: '201' }
+ refs:
+ - { parentEndpoint:
'GET:/resteasy-6.x-scenario/case/resttemplate', networkAddress:
'localhost:8080', refType: CrossProcess,
+ parentSpanId: 1, parentTraceSegmentId: not null,
parentServiceInstance: not
+ null, parentService: resteasy-6.x-scenario, traceId: not
null }
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: GET:/resteasy-6.x-scenario/get/1
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 1
+ isError: false
+ spanType: Entry
+ peer: ''
+ tags:
+ - { key: url, value:
'http://localhost:8080/resteasy-6.x-scenario/get/1' }
+ - { key: http.method, value: GET }
+ - { key: http.status_code, value: '200' }
+ refs:
+ - { parentEndpoint:
'GET:/resteasy-6.x-scenario/case/resttemplate', networkAddress:
'localhost:8080', refType: CrossProcess,
+ parentSpanId: 2, parentTraceSegmentId: not null,
parentServiceInstance: not
+ null, parentService: resteasy-6.x-scenario, traceId: not
null }
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: PUT:/resteasy-6.x-scenario/update/1
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 1
+ isError: false
+ spanType: Entry
+ peer: ''
+ tags:
+ - { key: url, value:
'http://localhost:8080/resteasy-6.x-scenario/update/1' }
+ - { key: http.method, value: PUT }
+ - { key: http.status_code, value: '200' }
+ refs:
+ - { parentEndpoint:
'GET:/resteasy-6.x-scenario/case/resttemplate', networkAddress:
'localhost:8080', refType: CrossProcess,
+ parentSpanId: 3, parentTraceSegmentId: not null,
parentServiceInstance: not
+ null, parentService: resteasy-6.x-scenario, traceId: not
null }
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: DELETE:/resteasy-6.x-scenario/delete/1
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 1
+ isError: false
+ spanType: Entry
+ peer: ''
+ tags:
+ - { key: url, value:
'http://localhost:8080/resteasy-6.x-scenario/delete/1' }
+ - { key: http.method, value: DELETE }
+ - { key: http.status_code, value: '204' }
+ refs:
+ - { parentEndpoint:
'GET:/resteasy-6.x-scenario/case/resttemplate', networkAddress:
'localhost:8080', refType: CrossProcess,
+ parentSpanId: 4, parentTraceSegmentId: not null,
parentServiceInstance: not
+ null, parentService: resteasy-6.x-scenario, traceId: not
null }
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: /resteasy-6.x-scenario/create/
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 2
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ tags:
+ - { key: url, value:
'http://localhost:8080/resteasy-6.x-scenario/create/' }
+ - { key: http.method, value: POST }
+ - { key: http.status_code, value: '201' }
+ skipAnalysis: 'false'
+ - operationName: /resteasy-6.x-scenario/get/1
+ parentSpanId: 0
+ spanId: 2
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 2
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ tags:
+ - { key: url, value:
'http://localhost:8080/resteasy-6.x-scenario/get/1' }
+ - { key: http.method, value: GET }
+ - { key: http.status_code, value: '200' }
+ skipAnalysis: 'false'
+ - operationName: /resteasy-6.x-scenario/update/1
+ parentSpanId: 0
+ spanId: 3
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 2
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ tags:
+ - { key: url, value:
'http://localhost:8080/resteasy-6.x-scenario/update/1' }
+ - { key: http.method, value: PUT }
+ - { key: http.status_code, value: '200' }
+ skipAnalysis: 'false'
+ - operationName: /resteasy-6.x-scenario/delete/1
+ parentSpanId: 0
+ spanId: 4
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 2
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ tags:
+ - { key: url, value:
'http://localhost:8080/resteasy-6.x-scenario/delete/1' }
+ - { key: http.method, value: DELETE }
+ - { key: http.status_code, value: '204' }
+ skipAnalysis: 'false'
+ - operationName: GET:/resteasy-6.x-scenario/case/resttemplate
+ 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/resteasy-6.x-scenario/case/resttemplate' }
+ - { key: http.method, value: GET }
+ - { key: http.status_code, value: '200' }
diff --git a/test/plugin/scenarios/resteasy-4.x-scenario/support-version.list
b/test/plugin/scenarios/resteasy-6.x-scenario/configuration.yml
similarity index 75%
copy from test/plugin/scenarios/resteasy-4.x-scenario/support-version.list
copy to test/plugin/scenarios/resteasy-6.x-scenario/configuration.yml
index f671bc5b79..866c8beca2 100644
--- a/test/plugin/scenarios/resteasy-4.x-scenario/support-version.list
+++ b/test/plugin/scenarios/resteasy-6.x-scenario/configuration.yml
@@ -14,12 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# test all 4.x version, with corresponding latest patch version
-4.7.6.Final
-4.6.2.Final
-4.5.12.Final
-4.4.3.Final
-4.3.1.Final
-4.2.0.Final
-4.1.1.Final
-4.0.0.Final
\ No newline at end of file
+type: tomcat
+entryService: http://localhost:8080/resteasy-6.x-scenario/case/resttemplate
+healthCheck: http://localhost:8080/resteasy-6.x-scenario/healthCheck
+environment:
+ - CATALINA_OPTS="-Dskywalking.plugin.http.include_http_headers=mock_header"
\ No newline at end of file
diff --git a/test/plugin/scenarios/resteasy-6.x-scenario/pom.xml
b/test/plugin/scenarios/resteasy-6.x-scenario/pom.xml
new file mode 100644
index 0000000000..c2b31f11ce
--- /dev/null
+++ b/test/plugin/scenarios/resteasy-6.x-scenario/pom.xml
@@ -0,0 +1,107 @@
+<?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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.skywalking</groupId>
+ <artifactId>resteasy-6.x-scenario</artifactId>
+ <version>1.0.0</version>
+ <packaging>war</packaging>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <compiler.version>17</compiler.version>
+ <test.framework.version>6.2.4.Final</test.framework.version>
+ <log4j.version>2.8.1</log4j.version>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-core</artifactId>
+ <version>${test.framework.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxb-provider</artifactId>
+ <version>${test.framework.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-servlet-initializer</artifactId>
+ <version>${test.framework.version}</version>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jackson2-provider</artifactId>
+ <version>${test.framework.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-client</artifactId>
+ <version>${test.framework.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>jakarta.servlet</groupId>
+ <artifactId>jakarta.servlet-api</artifactId>
+ <version>6.0.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ <version>${log4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <version>${log4j.version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>resteasy-6.x-scenario</finalName>
+ <plugins>
+ <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-war-plugin</artifactId>
+ <version>3.3.1</version>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git
a/test/plugin/scenarios/resteasy-6.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/RestTemplateController.java
b/test/plugin/scenarios/resteasy-6.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/RestTemplateController.java
new file mode 100644
index 0000000000..a765550858
--- /dev/null
+++
b/test/plugin/scenarios/resteasy-6.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/RestTemplateController.java
@@ -0,0 +1,73 @@
+/*
+ * 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.apache.skywalking.apm.testcase;
+
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.client.Client;
+import jakarta.ws.rs.client.ClientBuilder;
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.client.WebTarget;
+import jakarta.ws.rs.core.Response;
+import test.apache.skywalking.apm.testcase.entity.User;
+
+@Path("/")
+public class RestTemplateController {
+
+ private static final String SUCCESS = "Success";
+
+ private static final String URL =
"http://localhost:8080/resteasy-6.x-scenario";
+
+ @GET
+ @Path("case/resttemplate")
+ public Response restTemplate() {
+ Client client = ClientBuilder.newBuilder().build();
+
+ // Create user
+ User userEntity = new User(1, "a");
+ WebTarget target = client.target(URL + "/create/");
+ Response response = target.request().post(Entity.json(userEntity));
+ String value = response.readEntity(String.class);
+ response.close();
+
+ // Find User
+ response = client.target(URL + "/get/1").request().get();
+ response.close();
+
+ //Modify user
+ User updateUserEntity = new User(1, "b");
+ response = client.target(URL +
"/update/1").request().put(Entity.json(updateUserEntity));
+ response.close();
+
+ //Delete user
+ response = client.target(URL + "/delete/1").request().delete();
+ response.close();
+
+ client.close();
+
+ return Response.ok(SUCCESS).build();
+ }
+
+ @GET
+ @Path("healthCheck")
+ public String healthCheck() {
+ return SUCCESS;
+ }
+
+}
\ No newline at end of file
diff --git
a/test/plugin/scenarios/resteasy-6.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/UserApplication.java
b/test/plugin/scenarios/resteasy-6.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/UserApplication.java
new file mode 100644
index 0000000000..7295f5f11b
--- /dev/null
+++
b/test/plugin/scenarios/resteasy-6.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/UserApplication.java
@@ -0,0 +1,40 @@
+/*
+ * 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.apache.skywalking.apm.testcase;
+
+import jakarta.ws.rs.ApplicationPath;
+import jakarta.ws.rs.core.Application;
+
+import java.util.HashSet;
+import java.util.Set;
+
+@ApplicationPath("/")
+public class UserApplication extends Application {
+ private final Set<Class<?>> classes = new HashSet<>();
+
+ public UserApplication() {
+ classes.add(UserResource.class);
+ classes.add(RestTemplateController.class);
+ }
+
+ @Override
+ public Set<Class<?>> getClasses() {
+ return classes;
+ }
+}
\ No newline at end of file
diff --git
a/test/plugin/scenarios/resteasy-6.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/UserResource.java
b/test/plugin/scenarios/resteasy-6.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/UserResource.java
new file mode 100644
index 0000000000..b4ac0faf1f
--- /dev/null
+++
b/test/plugin/scenarios/resteasy-6.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/UserResource.java
@@ -0,0 +1,78 @@
+/*
+ * 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.apache.skywalking.apm.testcase;
+
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.DELETE;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.PUT;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.PathParam;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
+import test.apache.skywalking.apm.testcase.entity.User;
+
+import java.net.URI;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+@Path("/")
+public class UserResource {
+
+ private static final Map<Integer, User> USERS = new ConcurrentHashMap<>();
+
+ @GET
+ @Path("/get/{id}")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Response getUser(@PathParam("id") int id) {
+ User currentUser = new User(id, "a");
+ return Response.ok(currentUser).build();
+ }
+
+ @POST
+ @Path("/create/")
+ @Produces(MediaType.APPLICATION_JSON)
+ @Consumes(MediaType.APPLICATION_JSON)
+ public Response createUser(User user) {
+ USERS.put(user.getId(), user);
+ return Response.created(URI.create("")).build();
+ }
+
+ @PUT
+ @Path("/update/{id}")
+ @Produces(MediaType.APPLICATION_JSON)
+ @Consumes(MediaType.APPLICATION_JSON)
+ public Response updateUser(@PathParam("id") int id, User user) {
+ User currentUser = new User(id, user.getUserName());
+ return Response.ok(currentUser).build();
+ }
+
+ @DELETE
+ @Path("/delete/{id}")
+ public Response deleteUser(@PathParam("id") int id) {
+ User currentUser = USERS.get(id);
+ if (currentUser == null) {
+ return Response.noContent().build();
+ }
+ USERS.remove(id);
+ return Response.noContent().build();
+ }
+}
\ No newline at end of file
diff --git
a/test/plugin/scenarios/resteasy-6.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/entity/User.java
b/test/plugin/scenarios/resteasy-6.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/entity/User.java
new file mode 100644
index 0000000000..547f1e3572
--- /dev/null
+++
b/test/plugin/scenarios/resteasy-6.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/entity/User.java
@@ -0,0 +1,55 @@
+/*
+ * 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.apache.skywalking.apm.testcase.entity;
+
+import java.io.Serializable;
+
+public class User implements Serializable {
+
+ private int id;
+ private String userName;
+
+ public User(int id) {
+ this.id = id;
+ }
+
+ public User(int id, String userName) {
+ this.id = id;
+ this.userName = userName;
+ }
+
+ public User() {
+ }
+
+ public String getUserName() {
+ return userName;
+ }
+
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+}
diff --git
a/test/plugin/scenarios/resteasy-6.x-scenario/src/main/resources/log4j2.xml
b/test/plugin/scenarios/resteasy-6.x-scenario/src/main/resources/log4j2.xml
new file mode 100644
index 0000000000..9849ed5a8a
--- /dev/null
+++ b/test/plugin/scenarios/resteasy-6.x-scenario/src/main/resources/log4j2.xml
@@ -0,0 +1,30 @@
+<?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="WARN">
+ <AppenderRef ref="Console"/>
+ </Root>
+ </Loggers>
+</Configuration>
\ No newline at end of file
diff --git
a/test/plugin/scenarios/resteasy-6.x-scenario/src/main/webapp/WEB-INF/web.xml
b/test/plugin/scenarios/resteasy-6.x-scenario/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000000..fa9443ebc2
--- /dev/null
+++
b/test/plugin/scenarios/resteasy-6.x-scenario/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,39 @@
+<!--
+ ~ 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.
+ ~
+ -->
+<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
+ http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
+ version="3.1">
+
+ <display-name>resteasy-server-6.x</display-name>
+ <servlet>
+ <servlet-name>resteasy-server-6.x</servlet-name>
+
<servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
+ <init-param>
+ <param-name>jakarta.ws.rs.Application</param-name>
+
<param-value>test.apache.skywalking.apm.testcase.UserApplication</param-value>
+ </init-param>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>resteasy-server-6.x</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file
diff --git a/test/plugin/scenarios/resteasy-4.x-scenario/support-version.list
b/test/plugin/scenarios/resteasy-6.x-scenario/support-version.list
similarity index 83%
copy from test/plugin/scenarios/resteasy-4.x-scenario/support-version.list
copy to test/plugin/scenarios/resteasy-6.x-scenario/support-version.list
index f671bc5b79..49ada0d6d6 100644
--- a/test/plugin/scenarios/resteasy-4.x-scenario/support-version.list
+++ b/test/plugin/scenarios/resteasy-6.x-scenario/support-version.list
@@ -14,12 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# test all 4.x version, with corresponding latest patch version
-4.7.6.Final
-4.6.2.Final
-4.5.12.Final
-4.4.3.Final
-4.3.1.Final
-4.2.0.Final
-4.1.1.Final
-4.0.0.Final
\ No newline at end of file
+# test all 6.x version, with corresponding latest patch version
+6.2.4.Final
+6.1.0.Final
+6.0.3.Final
\ No newline at end of file