diff --git a/Jenkinsfile-Agent-Test b/Jenkinsfile-Agent-Test
index dae1d1b4240c0d301c24665dba80ff653953d112..2a34b3f0f8baa0d4990559c66e6ecc1ddd263e86 100755
--- a/Jenkinsfile-Agent-Test
+++ b/Jenkinsfile-Agent-Test
@@ -67,8 +67,7 @@ pipeline {
sh './mvnw -f test/plugin/pom.xml clean package -DskipTests docker:build'
}
}
-
- stage('Test Cases Report (144)') {
+ stage('Test Cases Report (156)') {
steps {
echo "Test Cases Report"
}
@@ -100,6 +99,12 @@ pipeline {
sh 'bash test/plugin/run.sh netty-socketio-scenario'
}
}
+
+ stage('rabbitmq-scenario (12)') {
+ steps {
+ sh 'bash test/plugin/run.sh rabbitmq-scenario'
+ }
+ }
}
}
diff --git a/docs/en/guides/Plugin-test.md b/docs/en/guides/Plugin-test.md
index 169f6ff9a8c5179fc34e105be0c63d6bc8261059..ca6dd3e5d3bc667ca9674f217718787b0a408b23 100644
--- a/docs/en/guides/Plugin-test.md
+++ b/docs/en/guides/Plugin-test.md
@@ -612,12 +612,13 @@ stage('Run Agent Plugin Tests') {
Find the button 'detail' of your Workload in the PR page. Enter to the page and get the elapsed time of your task.
### Workload 1
-#### Group 1 (2247.00s)
+#### Group 1 (2709.00s)
scenario name | versions | elapsed time (sec)
---|---|---
apm-toolkit-trace | 1 | 87.00
jetty 9.x | 63 | 2043.00
netty-socketio 1.x | 4 | 117.00
+rabbitmq-scenario | 12 | 462
#### Group 2 (2291.98s)
scenario name | versions | elapsed time (sec)
diff --git a/test/plugin/scenarios/rabbitmq-scenario/bin/startup.sh b/test/plugin/scenarios/rabbitmq-scenario/bin/startup.sh
new file mode 100644
index 0000000000000000000000000000000000000000..c714c78b5a83862358165f95f790bdb086f162c5
--- /dev/null
+++ b/test/plugin/scenarios/rabbitmq-scenario/bin/startup.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+home="$(cd "$(dirname $0)"; pwd)"
+
+java -jar ${agent_opts} ${home}/../libs/rabbitmq-scenario.jar &
diff --git a/test/plugin/scenarios/rabbitmq-scenario/config/expectedData.yaml b/test/plugin/scenarios/rabbitmq-scenario/config/expectedData.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..ff452607518211a9e1d2896d89bace0155b4a18f
--- /dev/null
+++ b/test/plugin/scenarios/rabbitmq-scenario/config/expectedData.yaml
@@ -0,0 +1,83 @@
+# 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.
+registryItems:
+ applications:
+ - {rabbitmq-scenario: nq 0}
+ instances:
+ - {rabbitmq-scenario: 1}
+ operationNames:
+ - rabbitmq-scenario: [/rabbitmq-scenario/case/rabbitmq,RabbitMQ/Topic/Queue/test/Producer,RabbitMQ/Topic/Queue/test/Consumer]
+segmentItems:
+- applicationCode: rabbitmq-scenario
+ segmentSize: gt 2
+ segments:
+ - segmentId: not null
+ spans:
+ - operationName: RabbitMQ/Topic/Queue/test/Consumer
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: MQ
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 53
+ componentName: ''
+ isError: false
+ spanType: Entry
+ peer: ''
+ peerId: 0
+ tags:
+ - {key: mq.broker, value: 'not null'}
+ - {key: mq.topic, value: ''}
+ - {key: mq.queue, value: test}
+ refs:
+ - {parentEndpointId: 0, parentEndpoint: /rabbitmq-scenario/case/rabbitmq, networkAddressId: 0,entryEndpointId: 0, refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not null,parentServiceInstanceId: nq 0, networkAddress: not null, entryEndpoint: /rabbitmq-scenario/case/rabbitmq,entryServiceInstanceId: nq 0}
+ - segmentId: not null
+ spans:
+ - operationName: RabbitMQ/Topic/Queue/test/Producer
+ operationId: 0
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: MQ
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 52
+ componentName: ''
+ isError: false
+ spanType: Exit
+ peer: not null
+ peerId: 0
+ tags:
+ - {key: mq.broker, value: 'not null'}
+ - {key: mq.queue, value: test}
+ - {key: mq.topic, value: ''}
+ - operationName: /rabbitmq-scenario/case/rabbitmq
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 1
+ componentName: ''
+ isError: false
+ spanType: Entry
+ peer: ''
+ peerId: 0
+ tags:
+ - {key: url, value: 'http://localhost:8080/rabbitmq-scenario/case/rabbitmq'}
+ - {key: http.method, value: GET}
+
diff --git a/test/plugin/scenarios/rabbitmq-scenario/configuration.yml b/test/plugin/scenarios/rabbitmq-scenario/configuration.yml
new file mode 100644
index 0000000000000000000000000000000000000000..d060a2a167b5dbdd9952f31092579384cc408ef0
--- /dev/null
+++ b/test/plugin/scenarios/rabbitmq-scenario/configuration.yml
@@ -0,0 +1,32 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+type: jvm
+entryService: http://localhost:8080/rabbitmq-scenario/case/rabbitmq
+healthCheck: http://localhost:8080/rabbitmq-scenario/case/healthcheck
+startScript: ./bin/startup.sh
+framework: rabbitmq
+environment:
+ - RABBITMQ_HOST=rabbitmq-server
+dependencies:
+ rabbitmq-server:
+ image: rabbitmq:latest
+ hostname: rabbitmq-server
+ expose:
+ - 5672
+ - 15672
+ environment:
+ - RABBITMQ_DEFAULT_PASS=admin
+ - RABBITMQ_DEFAULT_USER=admin
+ - RABBITMQ_DEFAULT_VHOST=/
diff --git a/test/plugin/scenarios/rabbitmq-scenario/pom.xml b/test/plugin/scenarios/rabbitmq-scenario/pom.xml
new file mode 100644
index 0000000000000000000000000000000000000000..b011609ea3e0c9ab8e8b74f9879c58b85d14f3a0
--- /dev/null
+++ b/test/plugin/scenarios/rabbitmq-scenario/pom.xml
@@ -0,0 +1,120 @@
+
+
+
+
+ 4.0.0
+
+ org.apache.skywalking
+ rabbitmq-scenario
+ 5.0.0-2018
+ skywalking-rabbitmq-scenario
+
+
+ UTF-8
+
+ 5.4.0
+ ${test.framework.version}
+
+ 2.8.1
+ 2.1.4.RELEASE
+
+
+
+
+ com.rabbitmq
+ amqp-client
+ ${test.framework.version}
+
+
+
+ org.springframework.boot
+ spring-boot-starter
+ ${spring-boot-version}
+
+
+ spring-boot-starter-logging
+ org.springframework.boot
+
+
+
+
+ org.apache.logging.log4j
+ log4j-api
+ ${log4j.version}
+
+
+ org.apache.logging.log4j
+ log4j-core
+ ${log4j.version}
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+ ${spring-boot-version}
+
+
+
+
+ rabbitmq-scenario
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+ 1.5.9.RELEASE
+
+
+
+ repackage
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.6.0
+
+ 1.8
+ 1.8
+ ${project.build.sourceEncoding}
+
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+
+
+ assemble
+ package
+
+ single
+
+
+
+ src/main/assembly/assembly.xml
+
+
+
+
+
+
+
+
diff --git a/test/plugin/scenarios/rabbitmq-scenario/src/main/assembly/assembly.xml b/test/plugin/scenarios/rabbitmq-scenario/src/main/assembly/assembly.xml
new file mode 100644
index 0000000000000000000000000000000000000000..7723d4cb88ce95f690b15017d81265c9ffa094a0
--- /dev/null
+++ b/test/plugin/scenarios/rabbitmq-scenario/src/main/assembly/assembly.xml
@@ -0,0 +1,41 @@
+
+
+
+
+ zip
+
+
+
+
+ ./bin
+ 0775
+
+
+
+
+
+ ${project.build.directory}/rabbitmq-scenario.jar
+ ./libs
+ 0775
+
+
+
diff --git a/test/plugin/scenarios/rabbitmq-scenario/src/main/java/org/apache/skywalking/apm/testcase/rabbitmq/Application.java b/test/plugin/scenarios/rabbitmq-scenario/src/main/java/org/apache/skywalking/apm/testcase/rabbitmq/Application.java
new file mode 100644
index 0000000000000000000000000000000000000000..0cbf8daedb6b7dda9ac96a1dd9dc39432e728db8
--- /dev/null
+++ b/test/plugin/scenarios/rabbitmq-scenario/src/main/java/org/apache/skywalking/apm/testcase/rabbitmq/Application.java
@@ -0,0 +1,36 @@
+/*
+ * 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.rabbitmq;
+
+import org.springframework.boot.SpringApplication;
+
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+
+@SpringBootApplication
+public class Application {
+
+ public static void main(String[] args) {
+ try {
+ SpringApplication.run(Application.class, args);
+ } catch (Exception e) {
+ // Never do this
+ }
+ }
+}
diff --git a/test/plugin/scenarios/rabbitmq-scenario/src/main/java/org/apache/skywalking/apm/testcase/rabbitmq/controller/CaseController.java b/test/plugin/scenarios/rabbitmq-scenario/src/main/java/org/apache/skywalking/apm/testcase/rabbitmq/controller/CaseController.java
new file mode 100644
index 0000000000000000000000000000000000000000..29566ad533bb8136d81c860e7c48d0999bc679ac
--- /dev/null
+++ b/test/plugin/scenarios/rabbitmq-scenario/src/main/java/org/apache/skywalking/apm/testcase/rabbitmq/controller/CaseController.java
@@ -0,0 +1,152 @@
+/*
+ * 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.rabbitmq.controller;
+
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import com.rabbitmq.client.*;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+
+import java.io.IOException;
+
+@RestController
+@RequestMapping("/case")
+@PropertySource("classpath:application.properties")
+public class CaseController {
+
+ private Logger logger = LogManager.getLogger(CaseController.class);
+
+
+ private static final String USERNAME = "admin";
+
+ private static final String PASSWORD = "admin";
+
+ @Value(value = "${rabbitmq.host:127.0.0.1}")
+ private String brokerUrl;
+
+ private static final int PORT = 5672;
+
+ private static final String QUEUE_NAME = "test";
+
+ private static final String MESSAGE = "rabbitmq-testcase";
+
+ @RequestMapping("/rabbitmq")
+ @ResponseBody
+ public String rabbitmqCase() throws Exception {
+ Channel channel = null;
+ Connection connection = null;
+
+ try{
+ ConnectionFactory factory = new ConnectionFactory();
+ logger.info("Using brokerUrl = " + brokerUrl);
+ factory.setHost(brokerUrl);
+ factory.setPort(PORT);
+ factory.setUsername(USERNAME);
+ factory.setPassword(PASSWORD);
+
+ connection = factory.newConnection();
+
+ channel = connection.createChannel();
+ channel.queueDeclare(QUEUE_NAME, false, false, false, null);
+ AMQP.BasicProperties.Builder propsBuilder = new AMQP.BasicProperties.Builder();
+ logger.info("Message being published -------------->"+MESSAGE);
+ channel.basicPublish("", QUEUE_NAME, propsBuilder.build(), MESSAGE.getBytes("UTF-8"));
+ logger.info("Message has been published-------------->"+MESSAGE);
+
+ final CountDownLatch waitForConsume = new CountDownLatch(1);
+ DeliverCallback deliverCallback = (consumerTag, delivery) -> {
+ String message = new String(delivery.getBody(), "UTF-8");
+ logger.info("Message received-------------->"+message);
+ waitForConsume.countDown();
+ };
+ channel.basicConsume(QUEUE_NAME, true, deliverCallback, consumerTag -> { });
+ waitForConsume.await(5000L, TimeUnit.MILLISECONDS);
+ logger.info("Message Consumed-------------->");
+
+ }catch (Exception ex){
+ logger.error(ex.toString());
+ }
+ finally {
+ if (channel != null) {
+ try {
+ channel.close();
+ }catch (Exception e){
+ // ignore
+ }
+ }
+ if (connection != null) {
+ try {
+ connection.close();
+ }catch (Exception e){
+ // ignore
+ }
+ }
+ }
+ return "Success";
+ }
+
+ @RequestMapping("/healthcheck")
+ public String healthCheck() throws Exception {
+ Channel channel = null;
+ Connection connection = null;
+
+ try{
+ ConnectionFactory factory = new ConnectionFactory();
+ logger.info("Using brokerUrl = " + brokerUrl);
+ factory.setHost(brokerUrl);
+ factory.setPort(PORT);
+ factory.setUsername(USERNAME);
+ factory.setPassword(PASSWORD);
+
+ connection = factory.newConnection();
+
+ channel = connection.createChannel();
+ channel.queueDeclare(QUEUE_NAME, false, false, false, null);
+ logger.info("Completed Health Check. Able to connect to RabbitMQ and create queue-------------->");
+ }catch (Exception ex){
+ logger.error(ex.toString());
+ throw ex;
+ }
+ finally {
+ if (channel != null) {
+ try {
+ channel.close();
+ }catch (Exception e){
+ // ignore
+ }
+ }
+ if (connection != null) {
+ try {
+ connection.close();
+ }catch (Exception e){
+ // ignore
+ }
+ }
+ }
+ return "Success";
+ }
+}
diff --git a/test/plugin/scenarios/rabbitmq-scenario/src/main/resources/application.properties b/test/plugin/scenarios/rabbitmq-scenario/src/main/resources/application.properties
new file mode 100644
index 0000000000000000000000000000000000000000..17ee2d47c05cfa0cbc17f54510d3b70adc3f3b01
--- /dev/null
+++ b/test/plugin/scenarios/rabbitmq-scenario/src/main/resources/application.properties
@@ -0,0 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
+
+server.port=8080
+server.servlet.context-path=/rabbitmq-scenario
diff --git a/test/plugin/scenarios/rabbitmq-scenario/src/main/resources/log4j2.xml b/test/plugin/scenarios/rabbitmq-scenario/src/main/resources/log4j2.xml
new file mode 100644
index 0000000000000000000000000000000000000000..c370d33b27e6b8bf09213b51bb353d54e4f7bc8e
--- /dev/null
+++ b/test/plugin/scenarios/rabbitmq-scenario/src/main/resources/log4j2.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/plugin/scenarios/rabbitmq-scenario/support-version.list b/test/plugin/scenarios/rabbitmq-scenario/support-version.list
new file mode 100644
index 0000000000000000000000000000000000000000..18d4e9f4aa8751159b419769d26b7c077b95516b
--- /dev/null
+++ b/test/plugin/scenarios/rabbitmq-scenario/support-version.list
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+5.5.1
+5.5.0
+5.4.3
+5.4.2
+5.4.1
+5.4.0
+5.3.0
+5.2.0
+5.1.2
+5.1.1
+5.1.0
+5.0.0