diff --git a/.github/workflows/plugins-jdk17-test.1.yaml b/.github/workflows/plugins-jdk17-test.1.yaml index 61bb8fa75a..949e69cfa1 100644 --- a/.github/workflows/plugins-jdk17-test.1.yaml +++ b/.github/workflows/plugins-jdk17-test.1.yaml @@ -62,6 +62,7 @@ jobs: - activemq-artemis-2.x-scenario - c3p0-0.9.0.x-0.9.1.x-scenario - c3p0-0.9.2.x-0.10.x-scenario + - spring-scheduled-6.x-scenario steps: - uses: actions/checkout@v2 with: diff --git a/.github/workflows/plugins-test.3.yaml b/.github/workflows/plugins-test.3.yaml index 7451dcf4b5..e687161731 100644 --- a/.github/workflows/plugins-test.3.yaml +++ b/.github/workflows/plugins-test.3.yaml @@ -81,7 +81,7 @@ jobs: - spring-kafka-1.3.x-scenario - spring-kafka-2.2.x-scenario - spring-kafka-2.3.x-scenario - - spring-scheduled-scenario + - spring-scheduled-3.x-5.x-scenario - elasticjob-2.x-scenario - quartz-scheduler-2.x-scenario - xxl-job-2.2.0-scenario diff --git a/CHANGES.md b/CHANGES.md index 6b6c759ae5..0340de503d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,7 @@ Release Notes. * Use a daemon thread to flush logs. * Fix typos in `URLParser`. * Add support for `Derby`/`Sybase`/`SQLite`/`DB2`/`OceanBase` jdbc url format in `URLParser`. +* Optimize spring-plugins:scheduled-annotation-plugin compatibility about Spring 6.1.x support. All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/213?closed=1) diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/scheduled-annotation-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/scheduled/define/ScheduledMethodInterceptorInstrumentation.java b/apm-sniffer/apm-sdk-plugin/spring-plugins/scheduled-annotation-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/scheduled/define/ScheduledMethodInterceptorInstrumentation.java index 2aacd3720b..44b36778bb 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/scheduled-annotation-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/scheduled/define/ScheduledMethodInterceptorInstrumentation.java +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/scheduled-annotation-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/scheduled/define/ScheduledMethodInterceptorInstrumentation.java @@ -82,6 +82,19 @@ public ElementMatcher getConstructorMatcher() { public String getConstructorInterceptor() { return CONSTRUCTOR_WITH_STRING_INTERCEPTOR_CLASS; } + }, + new ConstructorInterceptPoint() { + @Override + public ElementMatcher getConstructorMatcher() { + return takesArguments(4) + .and(takesArgument(0, Object.class)) + .and(takesArgument(1, Method.class)); + } + + @Override + public String getConstructorInterceptor() { + return CONSTRUCTOR_WITH_METHOD_INTERCEPTOR_CLASS; + } } }; } 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 9b21ea11d8..1fa2672282 100644 --- a/docs/en/setup/service-agent/java-agent/Supported-list.md +++ b/docs/en/setup/service-agent/java-agent/Supported-list.md @@ -120,7 +120,7 @@ metrics based on the tracing data. * Scheduler * [Elastic Job](https://github.com/elasticjob/elastic-job) 2.x * [Apache ShardingSphere-Elasticjob](https://github.com/apache/shardingsphere-elasticjob) 3.x - * [Spring @Scheduled](https://github.com/spring-projects/spring-framework) 3.1+ + * [Spring @Scheduled](https://github.com/spring-projects/spring-framework) 3.1.x -> 6.1.x * [Quartz Scheduler](https://github.com/quartz-scheduler/quartz) 2.x (Optional²) * [XXL Job](https://github.com/xuxueli/xxl-job) 2.x * OpenTracing community supported diff --git a/test/plugin/scenarios/rocketmq-5-grpc-scenario/src/main/java/test/apache/skywalking/apm/testcase/rocketmq/client/java/controller/MessageService.java b/test/plugin/scenarios/rocketmq-5-grpc-scenario/src/main/java/test/apache/skywalking/apm/testcase/rocketmq/client/java/controller/MessageService.java index 0c87f66981..f7d4dc3c9b 100644 --- a/test/plugin/scenarios/rocketmq-5-grpc-scenario/src/main/java/test/apache/skywalking/apm/testcase/rocketmq/client/java/controller/MessageService.java +++ b/test/plugin/scenarios/rocketmq-5-grpc-scenario/src/main/java/test/apache/skywalking/apm/testcase/rocketmq/client/java/controller/MessageService.java @@ -87,8 +87,8 @@ public void sendNormalMessageAsync(String topic, String tag, String group) throw .build(); try { CompletableFuture future = producer.sendAsync(message); - future.join(); - log.info("Send async message successfully"); + SendReceipt sendReceipt = future.join(); + log.info("Send async message successfully, messageId={}", sendReceipt.getMessageId()); } catch (Throwable t) { log.error("Failed to send message", t); } @@ -142,17 +142,34 @@ public void simpleConsumes(List topics, .build(); Duration invisibleDuration = Duration.ofSeconds(duration); - final List messages = consumer.receive(maxMessageNum, invisibleDuration); - messages.forEach(messageView -> { - log.info("Received message: {}", messageView); - }); - for (MessageView msg : messages) { - final MessageId messageId = msg.getMessageId(); - try { - consumer.ack(msg); - log.info("Message is acknowledged successfully, messageId={}", messageId); - } catch (Throwable t) { - log.error("Message is failed to be acknowledged, messageId={}", messageId, t); + int counter = 0; + int checkCounter = 0; + while (true) { + final List messages = consumer.receive(maxMessageNum, invisibleDuration); + messages.forEach(messageView -> { + log.info("Received message: {}", messageView); + }); + boolean finishFlag = false; + for (MessageView msg : messages) { + final MessageId messageId = msg.getMessageId(); + try { + consumer.ack(msg); + log.info("Message is acknowledged successfully, messageId={}", messageId); + counter++; + if (counter >= 2) { + finishFlag = true; + } + } catch (Throwable t) { + log.error("Message is failed to be acknowledged, messageId={}", messageId, t); + } + } + checkCounter++; + if (finishFlag) { + break; + } + if (checkCounter >= 3) { + log.error("Message is failed to receive after 3 attempts"); + break; } } } catch (Exception e) { diff --git a/test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/config/expectedData.yaml new file mode 100644 index 0000000000..285bb6bd3e --- /dev/null +++ b/test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/config/expectedData.yaml @@ -0,0 +1,68 @@ +# 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: spring-scheduled-3.x-5.x-scenario + segmentSize: ge 2 + segments: + - segmentId: not null + spans: + - operationName: GET:/spring-scheduled-3.x-5.x-scenario/case/call + 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/spring-scheduled-3.x-5.x-scenario/case/call'} + - {key: http.method, value: GET} + - {key: http.status_code, value: '200'} + refs: + - {parentEndpoint: SpringScheduled/org.apache.skywalking.apm.testcase.spring.scheduled.job.SchedulingJob.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: /spring-scheduled-3.x-5.x-scenario/case/call + 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/spring-scheduled-3.x-5.x-scenario/case/call'} + - {key: http.status_code, value: '200'} + - operationName: SpringScheduled/org.apache.skywalking.apm.testcase.spring.scheduled.job.SchedulingJob.work + parentSpanId: -1 + spanId: 0 + spanLayer: Unknown + startTime: not null + endTime: not null + componentId: 96 + isError: false + spanType: Local + peer: '' + skipAnalysis: false + tags: + - {key: x-le, value: '{"logic-span":true}'} diff --git a/test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/configuration.yml b/test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/configuration.yml new file mode 100644 index 0000000000..61cc0a3fb3 --- /dev/null +++ b/test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/configuration.yml @@ -0,0 +1,19 @@ +# 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: tomcat +entryService: http://localhost:8080/spring-scheduled-3.x-5.x-scenario/case/healthCheck +healthCheck: http://localhost:8080/spring-scheduled-3.x-5.x-scenario/case/healthCheck \ No newline at end of file diff --git a/test/plugin/scenarios/spring-scheduled-scenario/pom.xml b/test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/pom.xml similarity index 94% rename from test/plugin/scenarios/spring-scheduled-scenario/pom.xml rename to test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/pom.xml index 10f388f6ac..8dd8e29cbe 100644 --- a/test/plugin/scenarios/spring-scheduled-scenario/pom.xml +++ b/test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/pom.xml @@ -21,13 +21,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> org.apache.skywalking.apm.testcase - spring-scheduled-scenario + spring-scheduled-3.x-5.x-scenario 1.0.0 war 4.0.0 - skywalking-spring-scheduled-scenario + skywalking-spring-scheduled-3.x-5.x-scenario UTF-8 @@ -92,7 +92,7 @@ - spring-scheduled-scenario + spring-scheduled-3.x-5.x-scenario maven-compiler-plugin @@ -109,7 +109,7 @@ 2.1 8080 - /spring-scheduled-scenario + /spring-scheduled-3.x-5.x-scenario UTF-8 tomcat7 diff --git a/test/plugin/scenarios/spring-scheduled-scenario/src/main/java/org/apache/skywalking/apm/testcase/spring/scheduled/controller/CaseController.java b/test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/spring/scheduled/controller/CaseController.java similarity index 100% rename from test/plugin/scenarios/spring-scheduled-scenario/src/main/java/org/apache/skywalking/apm/testcase/spring/scheduled/controller/CaseController.java rename to test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/spring/scheduled/controller/CaseController.java diff --git a/test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/spring/scheduled/job/SchedulingJob.java b/test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/spring/scheduled/job/SchedulingJob.java new file mode 100644 index 0000000000..c943af8a56 --- /dev/null +++ b/test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/spring/scheduled/job/SchedulingJob.java @@ -0,0 +1,48 @@ +/* + * 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.spring.scheduled.job; + +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; + +import java.io.IOException; + +@Configuration +@EnableScheduling +public class SchedulingJob { + + private static final Logger LOGGER = LogManager.getLogger(SchedulingJob.class); + + private static final OkHttpClient CLIENT = new OkHttpClient.Builder().build(); + + @Scheduled(fixedDelay = 5000) + public void work() throws IOException { + LOGGER.info("work job running!"); + + Request request = new Request.Builder().url("http://localhost:8080/spring-scheduled-3.x-5.x-scenario/case/call").build(); + Response response = CLIENT.newCall(request).execute(); + response.body().close(); + } +} diff --git a/test/plugin/scenarios/spring-scheduled-scenario/src/main/resources/log4j2.xml b/test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/src/main/resources/log4j2.xml similarity index 100% rename from test/plugin/scenarios/spring-scheduled-scenario/src/main/resources/log4j2.xml rename to test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/src/main/resources/log4j2.xml diff --git a/test/plugin/scenarios/spring-scheduled-scenario/src/main/webapp/WEB-INF/spring-mvc-servlet.xml b/test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/src/main/webapp/WEB-INF/spring-mvc-servlet.xml similarity index 100% rename from test/plugin/scenarios/spring-scheduled-scenario/src/main/webapp/WEB-INF/spring-mvc-servlet.xml rename to test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/src/main/webapp/WEB-INF/spring-mvc-servlet.xml diff --git a/test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/src/main/webapp/WEB-INF/web.xml b/test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..041c8b4f29 --- /dev/null +++ b/test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,34 @@ + + + skywalking-spring-scheduled-3.x-5.x-scenario + + + spring-mvc + org.springframework.web.servlet.DispatcherServlet + 1 + + + spring-mvc + / + + diff --git a/test/plugin/scenarios/spring-scheduled-scenario/support-version.list b/test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/support-version.list similarity index 97% rename from test/plugin/scenarios/spring-scheduled-scenario/support-version.list rename to test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/support-version.list index 78ff603b37..9685fe8ec3 100644 --- a/test/plugin/scenarios/spring-scheduled-scenario/support-version.list +++ b/test/plugin/scenarios/spring-scheduled-3.x-5.x-scenario/support-version.list @@ -22,4 +22,5 @@ 4.3.28.RELEASE 5.0.18.RELEASE 5.1.17.RELEASE -5.2.8.RELEASE +5.2.25.RELEASE +5.3.34 \ No newline at end of file diff --git a/test/plugin/scenarios/spring-scheduled-scenario/config/expectedData.yaml b/test/plugin/scenarios/spring-scheduled-6.x-scenario/config/expectedData.yaml similarity index 91% rename from test/plugin/scenarios/spring-scheduled-scenario/config/expectedData.yaml rename to test/plugin/scenarios/spring-scheduled-6.x-scenario/config/expectedData.yaml index 1c5f45888c..f0a297781f 100644 --- a/test/plugin/scenarios/spring-scheduled-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/spring-scheduled-6.x-scenario/config/expectedData.yaml @@ -14,12 +14,12 @@ # See the License for the specific language governing permissions and # limitations under the License. segmentItems: -- serviceName: spring-scheduled-scenario +- serviceName: spring-scheduled-6.x-scenario segmentSize: ge 2 segments: - segmentId: not null spans: - - operationName: GET:/spring-scheduled-scenario/case/call + - operationName: GET:/spring-scheduled-6.x-scenario/case/call parentSpanId: -1 spanId: 0 spanLayer: Http @@ -31,14 +31,14 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: url, value: 'http://localhost:8080/spring-scheduled-scenario/case/call'} + - {key: url, value: 'http://localhost:8080/spring-scheduled-6.x-scenario/case/call'} - {key: http.method, value: GET} - {key: http.status_code, value: '200'} refs: - {parentEndpoint: SpringScheduled/org.apache.skywalking.apm.testcase.spring.scheduled.job.SchedulingJob.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: /spring-scheduled-scenario/case/call + - operationName: /spring-scheduled-6.x-scenario/case/call parentSpanId: 0 spanId: 1 spanLayer: Http @@ -51,7 +51,7 @@ segmentItems: skipAnalysis: false tags: - {key: http.method, value: GET} - - {key: url, value: 'http://localhost:8080/spring-scheduled-scenario/case/call'} + - {key: url, value: 'http://localhost:8080/spring-scheduled-6.x-scenario/case/call'} - {key: http.status_code, value: '200'} - operationName: SpringScheduled/org.apache.skywalking.apm.testcase.spring.scheduled.job.SchedulingJob.work parentSpanId: -1 diff --git a/test/plugin/scenarios/spring-scheduled-scenario/configuration.yml b/test/plugin/scenarios/spring-scheduled-6.x-scenario/configuration.yml similarity index 82% rename from test/plugin/scenarios/spring-scheduled-scenario/configuration.yml rename to test/plugin/scenarios/spring-scheduled-6.x-scenario/configuration.yml index 93a92b6b00..9fec8d6ef0 100644 --- a/test/plugin/scenarios/spring-scheduled-scenario/configuration.yml +++ b/test/plugin/scenarios/spring-scheduled-6.x-scenario/configuration.yml @@ -15,5 +15,5 @@ # limitations under the License. type: tomcat -entryService: http://localhost:8080/spring-scheduled-scenario/case/healthCheck -healthCheck: http://localhost:8080/spring-scheduled-scenario/case/healthCheck \ No newline at end of file +entryService: http://localhost:8080/spring-scheduled-6.x-scenario/case/healthCheck +healthCheck: http://localhost:8080/spring-scheduled-6.x-scenario/case/healthCheck \ No newline at end of file diff --git a/test/plugin/scenarios/spring-scheduled-6.x-scenario/pom.xml b/test/plugin/scenarios/spring-scheduled-6.x-scenario/pom.xml new file mode 100644 index 0000000000..273d32a00b --- /dev/null +++ b/test/plugin/scenarios/spring-scheduled-6.x-scenario/pom.xml @@ -0,0 +1,112 @@ + + + + + org.apache.skywalking.apm.testcase + spring-scheduled-6.x-scenario + 1.0.0 + war + + 4.0.0 + + skywalking-spring-scheduled-6.x-scenario + + + UTF-8 + 17 + 3.8.1 + 1.18.20 + 6.1.6 + spring-scheduled + + + + + jakarta.servlet + jakarta.servlet-api + 6.0.0 + provided + + + org.apache.logging.log4j + log4j-api + 2.8.1 + + + org.apache.logging.log4j + log4j-core + 2.8.1 + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + org.springframework + spring-context + ${test.framework.version} + + + org.springframework + spring-web + ${test.framework.version} + + + org.springframework + spring-webmvc + ${test.framework.version} + + + cglib + cglib + 2.2 + + + + com.squareup.okhttp3 + okhttp + 3.0.0 + + + + + spring-scheduled-6.x-scenario + + + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${compiler.version} + ${compiler.version} + ${project.build.sourceEncoding} + + + + org.apache.maven.plugins + maven-war-plugin + 3.3.1 + + + + diff --git a/test/plugin/scenarios/spring-scheduled-6.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/spring/scheduled/controller/CaseController.java b/test/plugin/scenarios/spring-scheduled-6.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/spring/scheduled/controller/CaseController.java new file mode 100644 index 0000000000..41dd892c59 --- /dev/null +++ b/test/plugin/scenarios/spring-scheduled-6.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/spring/scheduled/controller/CaseController.java @@ -0,0 +1,46 @@ +/* + * 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.spring.scheduled.controller; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +@Controller +@RequestMapping("/case") +public class CaseController { + + private static final Logger LOGGER = LogManager.getLogger(CaseController.class); + + private static final String SUCCESS = "Success"; + + @RequestMapping("/healthCheck") + @ResponseBody + public String healthCheck() { + return SUCCESS; + } + + @RequestMapping("/call") + @ResponseBody + public String call() { + return SUCCESS; + } +} diff --git a/test/plugin/scenarios/spring-scheduled-scenario/src/main/java/org/apache/skywalking/apm/testcase/spring/scheduled/job/SchedulingJob.java b/test/plugin/scenarios/spring-scheduled-6.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/spring/scheduled/job/SchedulingJob.java similarity index 96% rename from test/plugin/scenarios/spring-scheduled-scenario/src/main/java/org/apache/skywalking/apm/testcase/spring/scheduled/job/SchedulingJob.java rename to test/plugin/scenarios/spring-scheduled-6.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/spring/scheduled/job/SchedulingJob.java index dc36b167e6..fd2e65ec45 100644 --- a/test/plugin/scenarios/spring-scheduled-scenario/src/main/java/org/apache/skywalking/apm/testcase/spring/scheduled/job/SchedulingJob.java +++ b/test/plugin/scenarios/spring-scheduled-6.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/spring/scheduled/job/SchedulingJob.java @@ -41,7 +41,7 @@ public class SchedulingJob { public void work() throws IOException { LOGGER.info("work job running!"); - Request request = new Request.Builder().url("http://localhost:8080/spring-scheduled-scenario/case/call").build(); + Request request = new Request.Builder().url("http://localhost:8080/spring-scheduled-6.x-scenario/case/call").build(); Response response = CLIENT.newCall(request).execute(); response.body().close(); } diff --git a/test/plugin/scenarios/spring-scheduled-6.x-scenario/src/main/resources/log4j2.xml b/test/plugin/scenarios/spring-scheduled-6.x-scenario/src/main/resources/log4j2.xml new file mode 100644 index 0000000000..b16354bfa3 --- /dev/null +++ b/test/plugin/scenarios/spring-scheduled-6.x-scenario/src/main/resources/log4j2.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/plugin/scenarios/spring-scheduled-6.x-scenario/src/main/webapp/WEB-INF/spring-mvc-servlet.xml b/test/plugin/scenarios/spring-scheduled-6.x-scenario/src/main/webapp/WEB-INF/spring-mvc-servlet.xml new file mode 100644 index 0000000000..78ce64329d --- /dev/null +++ b/test/plugin/scenarios/spring-scheduled-6.x-scenario/src/main/webapp/WEB-INF/spring-mvc-servlet.xml @@ -0,0 +1,38 @@ + + + + + + + + + + \ No newline at end of file diff --git a/test/plugin/scenarios/spring-scheduled-scenario/src/main/webapp/WEB-INF/web.xml b/test/plugin/scenarios/spring-scheduled-6.x-scenario/src/main/webapp/WEB-INF/web.xml similarity index 95% rename from test/plugin/scenarios/spring-scheduled-scenario/src/main/webapp/WEB-INF/web.xml rename to test/plugin/scenarios/spring-scheduled-6.x-scenario/src/main/webapp/WEB-INF/web.xml index 97967a024e..2bbdb36e96 100644 --- a/test/plugin/scenarios/spring-scheduled-scenario/src/main/webapp/WEB-INF/web.xml +++ b/test/plugin/scenarios/spring-scheduled-6.x-scenario/src/main/webapp/WEB-INF/web.xml @@ -20,7 +20,7 @@ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1"> - skywalking-spring-scheduled-scenario + skywalking-spring-scheduled-6.x-scenario spring-mvc diff --git a/test/plugin/scenarios/spring-scheduled-6.x-scenario/support-version.list b/test/plugin/scenarios/spring-scheduled-6.x-scenario/support-version.list new file mode 100644 index 0000000000..44322d6089 --- /dev/null +++ b/test/plugin/scenarios/spring-scheduled-6.x-scenario/support-version.list @@ -0,0 +1,18 @@ +# 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. + +6.0.19 +6.1.6 \ No newline at end of file