You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2018/08/01 09:59:15 UTC

[GitHub] WithLin closed pull request #1512: [Agent] Provide plugin for Activemq 5.x

WithLin closed pull request #1512: [Agent] Provide plugin for Activemq 5.x
URL: https://github.com/apache/incubator-skywalking/pull/1512
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/apm-collector/apm-collector-boot/src/main/resources/application.yml b/apm-collector/apm-collector-boot/src/main/resources/application.yml
index 7732967fc..1ef027952 100644
--- a/apm-collector/apm-collector-boot/src/main/resources/application.yml
+++ b/apm-collector/apm-collector-boot/src/main/resources/application.yml
@@ -70,9 +70,9 @@ ui:
     contextPath: /
 storage:
   elasticsearch:
-    clusterName: CollectorDBCluster
-    clusterTransportSniffer: true
-    clusterNodes: localhost:9300
+    clusterName: docker-cluster
+    clusterTransportSniffer: false
+    clusterNodes: tututech.f3322.net:9300
     indexShardsNumber: 2
     indexReplicasNumber: 0
     highPerformanceMode: true
diff --git a/apm-collector/apm-collector-boot/src/main/resources/component-libraries.yml b/apm-collector/apm-collector-boot/src/main/resources/component-libraries.yml
index 63ca19870..3fc6be5be 100644
--- a/apm-collector/apm-collector-boot/src/main/resources/component-libraries.yml
+++ b/apm-collector/apm-collector-boot/src/main/resources/component-libraries.yml
@@ -156,7 +156,15 @@ mongodb-driver:
 SOFARPC:
   id: 43
   languages: Java
-
+ActiveMQ:
+  id: 44
+  languages: Java
+activemq-producer:
+  id: 45
+  languages: Java
+activemq-consumer:
+  id: 46
+  languages: Java
 # .NET/.NET Core components
 # [3000, 4000) for C#/.NET only
 AspNetCore:
@@ -223,6 +231,8 @@ Component-Server-Mappings:
   rocketMQ-consumer: RocketMQ
   kafka-producer: Kafka
   kafka-consumer: Kafka
+  activemq-producer: ActiveMQ
+  activemq-consumer: ActiveMQ
   postgresql-jdbc-driver: PostgreSQL
   Xmemcached: Memcached
   Spymemcached: Memcached
diff --git a/apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java b/apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java
index 6c9c95254..02a6730d4 100644
--- a/apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java
+++ b/apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java
@@ -92,6 +92,10 @@
 
     public static final OfficialComponent SOFARPC =  new OfficialComponent(43, "SOFARPC");
 
+    public static final  OfficialComponent ACTIVEMQ_PRODUCER = new OfficialComponent(45,"activemq-producer");
+
+    public static final  OfficialComponent ACTIVEMQ_CONSUMER = new OfficialComponent(46,"activemq-consumer");
+
     private static ComponentsDefine INSTANCE = new ComponentsDefine();
 
     private String[] components;
@@ -101,7 +105,7 @@ public static ComponentsDefine getInstance() {
     }
 
     public ComponentsDefine() {
-        components = new String[44];
+        components = new String[47];
         addComponent(TOMCAT);
         addComponent(HTTPCLIENT);
         addComponent(DUBBO);
@@ -135,6 +139,10 @@ public ComponentsDefine() {
         addComponent(KAFKA_CONSUMER);
         addComponent(MONGO_DRIVER);
         addComponent(SOFARPC);
+        addComponent(ACTIVEMQ_PRODUCER);
+        addComponent(ACTIVEMQ_CONSUMER);
+
+
     }
 
     private void addComponent(OfficialComponent component) {
diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/tag/Tags.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/tag/Tags.java
index e8802d472..3944a843e 100644
--- a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/tag/Tags.java
+++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/tag/Tags.java
@@ -59,6 +59,11 @@ private Tags() {
      */
     public static final StringTag DB_BIND_VARIABLES = new StringTag("db.bind_vars");
 
+    /**
+     * MQ_QUEUE records the queue name of message-middleware
+     */
+    public static final StringTag MQ_QUEUE = new StringTag("mq.queue");
+
     /**
      * MQ_BROKER records the broker address of message-middleware
      */
diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/activemq-5.x-plugin.iml b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/activemq-5.x-plugin.iml
new file mode 100644
index 000000000..0ba8c7590
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/activemq-5.x-plugin.iml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6">
+    <output url="file://$MODULE_DIR$/target/classes" />
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+      <excludeFolder url="file://$MODULE_DIR$/target" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.activemq:activemq-client:5.14.5" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.slf4j:slf4j-api:1.7.13" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1.1" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.fusesource.hawtbuf:hawtbuf:1.11" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:1.0.1" level="project" />
+    <orderEntry type="module" module-name="apm-agent-core" scope="PROVIDED" />
+    <orderEntry type="module" module-name="apm-network" scope="PROVIDED" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.grpc:grpc-netty:1.10.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.grpc:grpc-core:1.10.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.grpc:grpc-context:1.10.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.7" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: com.google.errorprone:error_prone_annotations:2.1.2" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:jsr305:3.0.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.opencensus:opencensus-api:0.11.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.opencensus:opencensus-contrib-grpc-metrics:0.11.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-codec-http2:4.1.17.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-codec-http:4.1.17.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-codec:4.1.17.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-handler:4.1.17.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-buffer:4.1.17.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-common:4.1.17.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-handler-proxy:4.1.17.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-transport:4.1.17.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-resolver:4.1.17.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-codec-socks:4.1.17.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.grpc:grpc-protobuf:1.10.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: com.google.protobuf:protobuf-java:3.5.1" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:19.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: com.google.protobuf:protobuf-java-util:3.5.1" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: com.google.api.grpc:proto-google-common-protos:1.0.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.grpc:grpc-protobuf-lite:1.10.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.grpc:grpc-stub:1.10.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-tcnative-boringssl-static:2.0.7.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: net.bytebuddy:byte-buddy:1.7.9" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: com.lmax:disruptor:3.3.6" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.httpcomponents:httpclient:4.5.3" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.httpcomponents:httpcore:4.4.6" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: commons-logging:commons-logging:1.2" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: commons-codec:commons-codec:1.9" level="project" />
+    <orderEntry type="module" module-name="apm-datacarrier" scope="PROVIDED" />
+    <orderEntry type="module" module-name="apm-util" scope="PROVIDED" />
+    <orderEntry type="module" module-name="apm-test-tools" scope="TEST" />
+    <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-all:1.10.19" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-module-junit4:1.6.4" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-module-junit4-common:1.6.4" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-core:1.6.4" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.javassist:javassist:3.20.0-GA" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-reflect:1.6.4" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-api-mockito:1.6.4" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:1.10.19" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.1" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-api-support:1.6.4" level="project" />
+  </component>
+</module>
\ No newline at end of file
diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/apm-activemq-5.x-plugin.iml b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/apm-activemq-5.x-plugin.iml
new file mode 100644
index 000000000..0ba8c7590
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/apm-activemq-5.x-plugin.iml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6">
+    <output url="file://$MODULE_DIR$/target/classes" />
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+      <excludeFolder url="file://$MODULE_DIR$/target" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.activemq:activemq-client:5.14.5" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.slf4j:slf4j-api:1.7.13" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1.1" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.fusesource.hawtbuf:hawtbuf:1.11" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:1.0.1" level="project" />
+    <orderEntry type="module" module-name="apm-agent-core" scope="PROVIDED" />
+    <orderEntry type="module" module-name="apm-network" scope="PROVIDED" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.grpc:grpc-netty:1.10.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.grpc:grpc-core:1.10.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.grpc:grpc-context:1.10.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.7" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: com.google.errorprone:error_prone_annotations:2.1.2" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:jsr305:3.0.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.opencensus:opencensus-api:0.11.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.opencensus:opencensus-contrib-grpc-metrics:0.11.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-codec-http2:4.1.17.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-codec-http:4.1.17.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-codec:4.1.17.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-handler:4.1.17.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-buffer:4.1.17.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-common:4.1.17.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-handler-proxy:4.1.17.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-transport:4.1.17.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-resolver:4.1.17.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-codec-socks:4.1.17.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.grpc:grpc-protobuf:1.10.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: com.google.protobuf:protobuf-java:3.5.1" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:19.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: com.google.protobuf:protobuf-java-util:3.5.1" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: com.google.api.grpc:proto-google-common-protos:1.0.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.grpc:grpc-protobuf-lite:1.10.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.grpc:grpc-stub:1.10.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty-tcnative-boringssl-static:2.0.7.Final" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: net.bytebuddy:byte-buddy:1.7.9" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: com.lmax:disruptor:3.3.6" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.httpcomponents:httpclient:4.5.3" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.httpcomponents:httpcore:4.4.6" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: commons-logging:commons-logging:1.2" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: commons-codec:commons-codec:1.9" level="project" />
+    <orderEntry type="module" module-name="apm-datacarrier" scope="PROVIDED" />
+    <orderEntry type="module" module-name="apm-util" scope="PROVIDED" />
+    <orderEntry type="module" module-name="apm-test-tools" scope="TEST" />
+    <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-all:1.10.19" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-module-junit4:1.6.4" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-module-junit4-common:1.6.4" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-core:1.6.4" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.javassist:javassist:3.20.0-GA" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-reflect:1.6.4" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-api-mockito:1.6.4" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:1.10.19" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.1" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-api-support:1.6.4" level="project" />
+  </component>
+</module>
\ No newline at end of file
diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/pom.xml
new file mode 100644
index 000000000..0e1525128
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/pom.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>apm-sdk-plugin</artifactId>
+        <groupId>org.apache.skywalking</groupId>
+        <version>5.0.0-RC-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>apm-activemq-5.x-plugin</artifactId>
+    <name>activemq-5.x-plugin</name>
+    <packaging>jar</packaging>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>activemq-client</artifactId>
+            <version>5.14.5</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <!-- 源码插件 -->
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+                <!-- 发布时自动将源码同时发布的配置 -->
+                <executions>
+                    <execution>
+                        <id>attach-sources</id>
+                        <phase>none</phase>
+                        <goals>
+                            <goal>jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org.apache.skywalking.apm.plugin.activemq/ActiveMQConsumerConstructorInterceptor.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org.apache.skywalking.apm.plugin.activemq/ActiveMQConsumerConstructorInterceptor.java
new file mode 100644
index 000000000..f92883f16
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org.apache.skywalking.apm.plugin.activemq/ActiveMQConsumerConstructorInterceptor.java
@@ -0,0 +1,31 @@
+/*
+ * 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.activemq;
+
+import org.apache.activemq.ActiveMQSession;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
+
+public class ActiveMQConsumerConstructorInterceptor implements InstanceConstructorInterceptor {
+    @Override
+    public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
+        ActiveMQSession session = (ActiveMQSession)allArguments[0];
+        objInst.setSkyWalkingDynamicField(session.getConnection().getTransport().getRemoteAddress().split("//")[1]);
+    }
+}
diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org.apache.skywalking.apm.plugin.activemq/ActiveMQConsumerInterceptor.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org.apache.skywalking.apm.plugin.activemq/ActiveMQConsumerInterceptor.java
new file mode 100644
index 000000000..382761786
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org.apache.skywalking.apm.plugin.activemq/ActiveMQConsumerInterceptor.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 org.apache.skywalking.apm.plugin.activemq;
+
+import org.apache.activemq.command.MessageDispatch;
+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 java.lang.reflect.Method;
+
+public class ActiveMQConsumerInterceptor implements InstanceMethodsAroundInterceptor {
+
+    public static final String OPERATE_NAME_PREFIX = "ActiveMQ/";
+    public static final String CONSUMER_OPERATE_NAME_SUFFIX = "/Consumer";
+    @Override
+    public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, MethodInterceptResult result) throws Throwable {
+        ContextCarrier contextCarrier = new ContextCarrier();
+        String url = (String) objInst.getSkyWalkingDynamicField();
+        MessageDispatch messageDispatch = (MessageDispatch) allArguments[0];
+        AbstractSpan activeSpan = null;
+        if (messageDispatch.getDestination().getDestinationType() == 1 ||  messageDispatch.getDestination().getDestinationType() == 5) {
+            activeSpan = ContextManager.createEntrySpan(OPERATE_NAME_PREFIX + "Queue/" + messageDispatch.getDestination().getPhysicalName() + CONSUMER_OPERATE_NAME_SUFFIX, null).start(System.currentTimeMillis());
+            Tags.MQ_BROKER.set(activeSpan, url);
+            Tags.MQ_QUEUE.set(activeSpan, messageDispatch.getDestination().getPhysicalName());
+        } else if (messageDispatch.getDestination().getDestinationType() == 2 ||  messageDispatch.getDestination().getDestinationType() == 6) {
+            activeSpan = ContextManager.createEntrySpan(OPERATE_NAME_PREFIX + "Topic/" + messageDispatch.getDestination().getPhysicalName() + CONSUMER_OPERATE_NAME_SUFFIX, null).start(System.currentTimeMillis());
+            Tags.MQ_BROKER.set(activeSpan, url);
+            Tags.MQ_TOPIC.set(activeSpan, messageDispatch.getDestination().getPhysicalName());
+        }
+        activeSpan.setComponent(ComponentsDefine.ACTIVEMQ_CONSUMER);
+        SpanLayer.asMQ(activeSpan);
+        CarrierItem next = contextCarrier.items();
+        while (next.hasNext()) {
+            next = next.next();
+            next.setHeadValue(messageDispatch.getMessage().getProperty(next.getHeadKey()).toString());
+        }
+        ContextManager.extract(contextCarrier);
+
+
+    }
+
+
+    @Override
+    public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Object ret) throws Throwable {
+        ContextManager.stopSpan();
+        return ret;
+
+    }
+
+    @Override
+    public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Throwable t) {
+        ContextManager.activeSpan().errorOccurred().log(t);
+    }
+}
diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org.apache.skywalking.apm.plugin.activemq/ActiveMQProducerConstructorInterceptor.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org.apache.skywalking.apm.plugin.activemq/ActiveMQProducerConstructorInterceptor.java
new file mode 100644
index 000000000..4681e87f5
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org.apache.skywalking.apm.plugin.activemq/ActiveMQProducerConstructorInterceptor.java
@@ -0,0 +1,31 @@
+/*
+ * 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.activemq;
+
+import org.apache.activemq.ActiveMQSession;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
+
+public class ActiveMQProducerConstructorInterceptor implements InstanceConstructorInterceptor {
+    @Override
+    public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
+        ActiveMQSession session = (ActiveMQSession)allArguments[0];
+        objInst.setSkyWalkingDynamicField(session.getConnection().getTransport().getRemoteAddress().split("//")[1]);
+    }
+}
diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org.apache.skywalking.apm.plugin.activemq/ActiveMQProducerInterceptor.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org.apache.skywalking.apm.plugin.activemq/ActiveMQProducerInterceptor.java
new file mode 100644
index 000000000..a96c01778
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org.apache.skywalking.apm.plugin.activemq/ActiveMQProducerInterceptor.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 org.apache.skywalking.apm.plugin.activemq;
+
+import org.apache.activemq.command.ActiveMQDestination;
+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 javax.jms.Message;
+import java.lang.reflect.Method;
+
+public class ActiveMQProducerInterceptor implements InstanceMethodsAroundInterceptor {
+    public static final String OPERATE_NAME_PREFIX = "ActiveMQ/";
+    public static final String PRODUCER_OPERATE_NAME_SUFFIX = "/Producer";
+    @Override
+    public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, MethodInterceptResult result) throws Throwable {
+
+        ContextCarrier contextCarrier = new ContextCarrier();
+        ActiveMQDestination activeMQDestination = (ActiveMQDestination) allArguments[0];
+        Message message = (Message)  allArguments[1];
+        String url = (String) objInst.getSkyWalkingDynamicField();
+        AbstractSpan activeSpan = null;
+        if (activeMQDestination.getDestinationType() == 1 || activeMQDestination.getDestinationType() == 5) {
+            activeSpan = ContextManager.createExitSpan(OPERATE_NAME_PREFIX + "Queue/" + activeMQDestination.getPhysicalName() + PRODUCER_OPERATE_NAME_SUFFIX, contextCarrier, url);
+            Tags.MQ_BROKER.set(activeSpan,url);
+            Tags.MQ_QUEUE.set(activeSpan,activeMQDestination.getPhysicalName());
+
+        } else if (activeMQDestination.getDestinationType() == 2 || activeMQDestination.getDestinationType() == 6) {
+            activeSpan = ContextManager.createExitSpan(OPERATE_NAME_PREFIX + "Topic/" + activeMQDestination.getPhysicalName() + PRODUCER_OPERATE_NAME_SUFFIX, contextCarrier, url);
+            Tags.MQ_BROKER.set(activeSpan, url);
+            Tags.MQ_TOPIC.set(activeSpan,activeMQDestination.getPhysicalName());
+        }
+        SpanLayer.asMQ(activeSpan);
+        activeSpan.setComponent(ComponentsDefine.ACTIVEMQ_PRODUCER);
+        CarrierItem next = contextCarrier.items();
+
+        while (next.hasNext()) {
+            next = next.next();
+            message.setStringProperty(next.getHeadKey(),next.getHeadValue());
+        }
+
+    }
+
+    @Override
+    public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Object ret) throws Throwable {
+        ContextManager.stopSpan();
+        return ret;
+    }
+
+    @Override
+    public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Throwable t) {
+        ContextManager.activeSpan().errorOccurred().log(t);
+    }
+}
\ No newline at end of file
diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org.apache.skywalking.apm.plugin.activemq/define/ActiveMQConsumerInstrumentation.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org.apache.skywalking.apm.plugin.activemq/define/ActiveMQConsumerInstrumentation.java
new file mode 100644
index 000000000..e6c31eb33
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org.apache.skywalking.apm.plugin.activemq/define/ActiveMQConsumerInstrumentation.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 org.apache.skywalking.apm.plugin.activemq.define;
+
+import net.bytebuddy.description.method.MethodDescription;
+import net.bytebuddy.matcher.ElementMatcher;
+import org.apache.activemq.ActiveMQSession;
+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.MultiClassNameMatch;
+
+
+import static net.bytebuddy.matcher.ElementMatchers.named;
+import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
+
+public class ActiveMQConsumerInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
+    public static final String INTERCEPTOR_CLASS = "org.apache.skywalking.apm.plugin.activemq.ActiveMQConsumerInterceptor";
+    public static final String ENHANCE_CLASS_CONSUMER = "org.apache.activemq.ActiveMQMessageConsumer";
+    public static final String CONSTRUCTOR_INTERCEPTOR_CLASS = "org.apache.skywalking.apm.plugin.activemq.ActiveMQConsumerConstructorInterceptor";
+    public static final String ENHANCE_METHOD_DISPATCH = "dispatch";
+    @Override
+    protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
+        return new ConstructorInterceptPoint[] {
+            new ConstructorInterceptPoint() {
+                    @Override public ElementMatcher<MethodDescription> getConstructorMatcher() {
+                        return takesArgument(0,ActiveMQSession.class);
+                    }
+
+                    @Override public String getConstructorInterceptor() {
+                        return CONSTRUCTOR_INTERCEPTOR_CLASS;
+                    }
+                }
+        };
+    }
+
+    @Override
+    protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
+        return new InstanceMethodsInterceptPoint[] {
+            new InstanceMethodsInterceptPoint() {
+                    @Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
+                        return named(ENHANCE_METHOD_DISPATCH);
+                    }
+
+
+                    @Override public String getMethodsInterceptor() {
+                        return INTERCEPTOR_CLASS;
+                    }
+
+                    @Override public boolean isOverrideArgs() {
+                        return false;
+                    }
+                }
+        };
+    }
+
+    @Override
+    protected ClassMatch enhanceClass() {
+        return MultiClassNameMatch.byMultiClassMatch(ENHANCE_CLASS_CONSUMER);
+    }
+}
\ No newline at end of file
diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org.apache.skywalking.apm.plugin.activemq/define/ActiveMQProducerInstrumentation.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org.apache.skywalking.apm.plugin.activemq/define/ActiveMQProducerInstrumentation.java
new file mode 100644
index 000000000..a5d6af763
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org.apache.skywalking.apm.plugin.activemq/define/ActiveMQProducerInstrumentation.java
@@ -0,0 +1,80 @@
+/*
+ * 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.activemq.define;
+
+import net.bytebuddy.description.method.MethodDescription;
+import net.bytebuddy.matcher.ElementMatcher;
+import org.apache.activemq.ActiveMQSession;
+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.MultiClassNameMatch;
+
+
+import static net.bytebuddy.matcher.ElementMatchers.named;
+import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
+import static org.apache.skywalking.apm.agent.core.plugin.bytebuddy.ArgumentTypeNameMatch.takesArgumentWithType;
+
+public class ActiveMQProducerInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
+    public static final String INTERCEPTOR_CLASS = "org.apache.skywalking.apm.plugin.activemq.ActiveMQProducerInterceptor";
+    public static final String ENHANCE_CLASS_PRODUCER = "org.apache.activemq.ActiveMQMessageProducer";
+    public static final String ENHANCE_CLASS_CONNECTIONFACTORY = "org.apache.activemq.ActiveMQConnectionFactory";
+    public static final String CONSTRUCTOR_INTERCEPTOR_CLASS = "org.apache.skywalking.apm.plugin.activemq.ActiveMQProducerConstructorInterceptor";
+    public static final String ENHANCE_METHOD = "send";
+    @Override
+    protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
+        return new ConstructorInterceptPoint[] {
+            new ConstructorInterceptPoint() {
+                    @Override public ElementMatcher<MethodDescription> getConstructorMatcher() {
+                        return takesArgument(0,ActiveMQSession.class);
+                    }
+
+                    @Override public String getConstructorInterceptor() {
+                        return CONSTRUCTOR_INTERCEPTOR_CLASS;
+                    }
+                }
+        };
+    }
+
+    @Override
+    protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
+        return new InstanceMethodsInterceptPoint[] {
+            new InstanceMethodsInterceptPoint() {
+                    @Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
+                        return named(ENHANCE_METHOD).and(takesArgumentWithType(0,"javax.jms.Destination")).and(takesArgumentWithType(1,"javax.jms.Message"));
+                    }
+
+
+                    @Override public String getMethodsInterceptor() {
+                        return INTERCEPTOR_CLASS;
+                    }
+
+                    @Override public boolean isOverrideArgs() {
+                        return false;
+                    }
+                }
+        };
+    }
+
+    @Override
+    protected ClassMatch enhanceClass() {
+        return MultiClassNameMatch.byMultiClassMatch(ENHANCE_CLASS_PRODUCER);
+    }
+}
\ No newline at end of file
diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/resources/skywalking-plugin.def b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/resources/skywalking-plugin.def
new file mode 100644
index 000000000..d9528a6bd
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/resources/skywalking-plugin.def
@@ -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.
+
+activemq-5.x=org.apache.skywalking.apm.plugin.activemq.define.ActiveMQProducerInstrumentation
+activemq-5.x=org.apache.skywalking.apm.plugin.activemq.define.ActiveMQConsumerInstrumentation
diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerAndProducerConstructorInterceptorTest.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerAndProducerConstructorInterceptorTest.java
new file mode 100644
index 000000000..ea7fbb1b3
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerAndProducerConstructorInterceptorTest.java
@@ -0,0 +1,201 @@
+package org.apache.skywalking.apm.plugin.activemq;
+
+import org.apache.activemq.ActiveMQConnection;
+import org.apache.activemq.ActiveMQSession;
+import org.apache.activemq.command.SessionId;
+import org.apache.activemq.management.JMSStatsImpl;
+import org.apache.activemq.transport.FutureResponse;
+import org.apache.activemq.transport.ResponseCallback;
+import org.apache.activemq.transport.Transport;
+import org.apache.activemq.transport.TransportListener;
+import org.apache.activemq.util.IdGenerator;
+import org.apache.activemq.wireformat.WireFormat;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+
+import javax.jms.JMSException;
+import java.io.IOException;
+import java.net.URI;
+import java.security.cert.X509Certificate;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+
+public class ActiveMQConsumerAndProducerConstructorInterceptorTest {
+
+    @Mock
+    private ActiveMQConnection activeMQConnection;
+
+    private IdGenerator idGenerator;
+
+    private JMSStatsImpl jmsStats;
+
+
+    @Mock
+    private ActiveMQSession activeMQSession;
+
+    private SessionId  sessionId;
+
+
+    public  class  TransportTest implements  Transport {
+
+        private  String remoteAddress;
+        @Override
+        public void oneway(Object o) throws IOException {
+
+        }
+
+        @Override
+        public FutureResponse asyncRequest(Object o, ResponseCallback responseCallback) throws IOException {
+            return null;
+        }
+
+        @Override
+        public Object request(Object o) throws IOException {
+            return null;
+        }
+
+        @Override
+        public Object request(Object o, int i) throws IOException {
+            return null;
+        }
+
+        @Override
+        public TransportListener getTransportListener() {
+            return null;
+        }
+
+        @Override
+        public void setTransportListener(TransportListener transportListener) {
+
+        }
+
+        @Override
+        public <T> T narrow(Class<T> aClass) {
+            return null;
+        }
+
+        @Override
+        public String getRemoteAddress() {
+            return this.remoteAddress;
+        }
+
+        public String setRemoteAddress(String remoteAddress) {
+            return this.remoteAddress = remoteAddress;
+        }
+
+        @Override
+        public boolean isFaultTolerant() {
+            return false;
+        }
+
+        @Override
+        public boolean isDisposed() {
+            return false;
+        }
+
+        @Override
+        public boolean isConnected() {
+            return false;
+        }
+
+        @Override
+        public boolean isReconnectSupported() {
+            return false;
+        }
+
+        @Override
+        public boolean isUpdateURIsSupported() {
+            return false;
+        }
+
+        @Override
+        public void reconnect(URI uri) throws IOException {
+
+        }
+
+        @Override
+        public void updateURIs(boolean b, URI[] uris) throws IOException {
+
+        }
+
+        @Override
+        public int getReceiveCounter() {
+            return 0;
+        }
+
+        @Override
+        public X509Certificate[] getPeerCertificates() {
+            return new X509Certificate[0];
+        }
+
+        @Override
+        public void setPeerCertificates(X509Certificate[] x509Certificates) {
+
+        }
+
+        @Override
+        public WireFormat getWireFormat() {
+            return null;
+        }
+
+        @Override
+        public void start() throws Exception {
+
+        }
+
+        @Override
+        public void stop() throws Exception {
+
+        }
+    }
+
+    public  class  TestConnection extends ActiveMQConnection {
+
+        public TestConnection(Transport transport, IdGenerator clientIdGenerator, IdGenerator connectionIdGenerator, JMSStatsImpl factoryStats) throws Exception {
+            super(transport, clientIdGenerator, connectionIdGenerator, factoryStats);
+        }
+    }
+
+    private class  TestActiveMQSession extends ActiveMQSession {
+
+        public TestActiveMQSession(ActiveMQConnection connection, SessionId sessionId, int acknowledgeMode, boolean asyncDispatch, boolean sessionAsyncDispatch) throws JMSException {
+            super(connection, sessionId, acknowledgeMode, asyncDispatch, sessionAsyncDispatch);
+        }
+    }
+
+    private  ActiveMQConsumerConstructorInterceptor activeMQConsumerAndProducerConstructorInterceptor;
+
+    private EnhancedInstance enhancedInstance = new EnhancedInstance() {
+        private String test;
+        @Override
+        public Object getSkyWalkingDynamicField() {
+            return test;
+        }
+
+        @Override
+        public void setSkyWalkingDynamicField(Object value) {
+            test = (String)value;
+        }
+    };
+    @Before
+    public void setUp() throws Exception {
+        TransportTest transport =  new TransportTest();
+        transport.setRemoteAddress("tcp://127.0.0.1:61616");
+        idGenerator = new  IdGenerator("aaa");
+        jmsStats = new JMSStatsImpl();
+        activeMQConnection = new TestConnection(transport,idGenerator,idGenerator,jmsStats);
+        sessionId = new SessionId();
+        activeMQSession = new TestActiveMQSession(activeMQConnection,sessionId,1,true,true);
+    }
+
+    @Test
+    public void TestActiveMQConsumerAndProducerConstructorInterceptor() {
+        activeMQConsumerAndProducerConstructorInterceptor = new ActiveMQConsumerConstructorInterceptor();
+        activeMQConsumerAndProducerConstructorInterceptor.onConstruct(enhancedInstance,new Object[] {activeMQSession});
+        assertThat((String) enhancedInstance.getSkyWalkingDynamicField(), is("127.0.0.1:61616"));
+    }
+}
\ No newline at end of file
diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerInterceptorTest.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerInterceptorTest.java
new file mode 100644
index 000000000..ea77903b6
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerInterceptorTest.java
@@ -0,0 +1,151 @@
+/*
+ * 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.activemq;
+
+import org.apache.activemq.command.ActiveMQDestination;
+import org.apache.activemq.command.Message;
+import org.apache.activemq.command.MessageDispatch;
+import org.apache.activemq.command.Response;
+import org.apache.activemq.state.CommandVisitor;
+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.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.TracingSegmentRunner;
+import org.junit.*;
+import org.junit.runner.RunWith;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.powermock.modules.junit4.PowerMockRunnerDelegate;
+import javax.jms.JMSException;
+import java.io.IOException;
+
+import java.util.List;
+
+import static org.hamcrest.CoreMatchers.is;
+
+import org.junit.Before;
+import org.junit.Test;
+
+@RunWith(PowerMockRunner.class)
+@PowerMockRunnerDelegate(TracingSegmentRunner.class)
+public class ActiveMQConsumerInterceptorTest {
+
+    @SegmentStoragePoint
+    private SegmentStorage segmentStorage;
+
+    @Rule
+    public AgentServiceRule serviceRule = new AgentServiceRule();
+
+    private ActiveMQConsumerInterceptor activeMQConsumerInterceptor;
+
+    private Object[] arguments;
+
+    private Class[] argumentType;
+
+    private MessageDispatch messageDispatch;
+
+    public  class  Des extends ActiveMQDestination {
+
+        @Override
+        protected String getQualifiedPrefix() {
+            return null;
+        }
+
+        @Override
+        public byte getDestinationType() {
+            return 1;
+        }
+
+        @Override
+        public byte getDataStructureType() {
+            return 0;
+        }
+    }
+
+    public  class  Msg extends Message {
+
+        @Override
+        public Message copy() {
+            return null;
+        }
+
+        @Override
+        public void clearBody() throws JMSException {
+
+        }
+
+        @Override
+        public void storeContent() {
+
+        }
+
+        @Override
+        public void storeContentAndClear() {
+
+        }
+
+        @Override
+        public Response visit(CommandVisitor commandVisitor) throws Exception {
+            return null;
+        }
+
+        @Override
+        public byte getDataStructureType() {
+            return 0;
+        }
+    }
+
+    private EnhancedInstance enhancedInstance = new EnhancedInstance() {
+        @Override
+        public Object getSkyWalkingDynamicField() {
+            return "localhost:60601";
+        }
+
+        @Override
+        public void setSkyWalkingDynamicField(Object value) {
+        }
+    };
+
+    @Before
+    public void setUp() throws IOException {
+        activeMQConsumerInterceptor = new ActiveMQConsumerInterceptor();
+        messageDispatch = new MessageDispatch();
+
+        Des des = new Des();
+        des.setPhysicalName("test");
+        messageDispatch.setDestination(des);
+        Message msg =  new Msg();
+        msg.setProperty("sw3","");
+        messageDispatch.setMessage(msg);
+        arguments = new Object[] {messageDispatch};
+        argumentType = null;
+    }
+
+    @Test
+    public void testConsumerWithoutMessage() throws Throwable {
+        activeMQConsumerInterceptor.beforeMethod(enhancedInstance,null,arguments,null,null);
+        activeMQConsumerInterceptor.afterMethod(enhancedInstance, null, arguments, null, null);
+
+        List<TraceSegment> traceSegments = segmentStorage.getTraceSegments();
+        Assert.assertThat(traceSegments.size(), is(1));
+    }
+
+}
\ No newline at end of file
diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQProducerInterceptorTest.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQProducerInterceptorTest.java
new file mode 100644
index 000000000..63fbf1166
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQProducerInterceptorTest.java
@@ -0,0 +1,365 @@
+/*
+ * 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.activemq;
+
+import java.util.List;
+
+import org.apache.activemq.ActiveMQMessageProducer;
+import org.apache.activemq.command.ActiveMQDestination;
+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.TraceSegment;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
+import org.apache.skywalking.apm.agent.test.helper.SegmentHelper;
+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.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.powermock.modules.junit4.PowerMockRunnerDelegate;
+
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import java.util.Enumeration;
+
+import static org.apache.skywalking.apm.network.trace.component.ComponentsDefine.ACTIVEMQ_PRODUCER;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+@RunWith(PowerMockRunner.class)
+@PowerMockRunnerDelegate(TracingSegmentRunner.class)
+public class ActiveMQProducerInterceptorTest {
+
+    @SegmentStoragePoint
+    private SegmentStorage segmentStorage;
+
+    @Rule
+    public AgentServiceRule serviceRule = new AgentServiceRule();
+
+    private ActiveMQProducerInterceptor producerInterceptor;
+
+    private Object[] arguments;
+
+    private Class[] argumentType;
+
+
+    private MQDestination mqDestination;
+
+
+    private Message message;
+
+
+
+    private  class  MQDestination extends ActiveMQDestination {
+
+        @Override
+        protected String getQualifiedPrefix() {
+            return null;
+        }
+
+        @Override
+        public byte getDestinationType() {
+            return 1;
+        }
+
+        @Override
+        public byte getDataStructureType() {
+            return 1;
+        }
+    }
+
+    public  class  Msg implements   Message {
+
+        @Override
+        public String getJMSMessageID() throws JMSException {
+            return null;
+        }
+
+        @Override
+        public void setJMSMessageID(String s) throws JMSException {
+
+        }
+
+        @Override
+        public long getJMSTimestamp() throws JMSException {
+            return 0;
+        }
+
+        @Override
+        public void setJMSTimestamp(long l) throws JMSException {
+
+        }
+
+        @Override
+        public byte[] getJMSCorrelationIDAsBytes() throws JMSException {
+            return new byte[0];
+        }
+
+        @Override
+        public void setJMSCorrelationIDAsBytes(byte[] bytes) throws JMSException {
+
+        }
+
+        @Override
+        public void setJMSCorrelationID(String s) throws JMSException {
+
+        }
+
+        @Override
+        public String getJMSCorrelationID() throws JMSException {
+            return null;
+        }
+
+        @Override
+        public Destination getJMSReplyTo() throws JMSException {
+            return null;
+        }
+
+        @Override
+        public void setJMSReplyTo(Destination destination) throws JMSException {
+
+        }
+
+        @Override
+        public Destination getJMSDestination() throws JMSException {
+            return null;
+        }
+
+        @Override
+        public void setJMSDestination(Destination destination) throws JMSException {
+
+        }
+
+        @Override
+        public int getJMSDeliveryMode() throws JMSException {
+            return 0;
+        }
+
+        @Override
+        public void setJMSDeliveryMode(int i) throws JMSException {
+
+        }
+
+        @Override
+        public boolean getJMSRedelivered() throws JMSException {
+            return false;
+        }
+
+        @Override
+        public void setJMSRedelivered(boolean b) throws JMSException {
+
+        }
+
+        @Override
+        public String getJMSType() throws JMSException {
+            return null;
+        }
+
+        @Override
+        public void setJMSType(String s) throws JMSException {
+
+        }
+
+        @Override
+        public long getJMSExpiration() throws JMSException {
+            return 0;
+        }
+
+        @Override
+        public void setJMSExpiration(long l) throws JMSException {
+
+        }
+
+        @Override
+        public int getJMSPriority() throws JMSException {
+            return 0;
+        }
+
+        @Override
+        public void setJMSPriority(int i) throws JMSException {
+
+        }
+
+        @Override
+        public void clearProperties() throws JMSException {
+
+        }
+
+        @Override
+        public boolean propertyExists(String s) throws JMSException {
+            return false;
+        }
+
+        @Override
+        public boolean getBooleanProperty(String s) throws JMSException {
+            return false;
+        }
+
+        @Override
+        public byte getByteProperty(String s) throws JMSException {
+            return 0;
+        }
+
+        @Override
+        public short getShortProperty(String s) throws JMSException {
+            return 0;
+        }
+
+        @Override
+        public int getIntProperty(String s) throws JMSException {
+            return 0;
+        }
+
+        @Override
+        public long getLongProperty(String s) throws JMSException {
+            return 0;
+        }
+
+        @Override
+        public float getFloatProperty(String s) throws JMSException {
+            return 0;
+        }
+
+        @Override
+        public double getDoubleProperty(String s) throws JMSException {
+            return 0;
+        }
+
+        @Override
+        public String getStringProperty(String s) throws JMSException {
+            return null;
+        }
+
+        @Override
+        public Object getObjectProperty(String s) throws JMSException {
+            return null;
+        }
+
+        @Override
+        public Enumeration getPropertyNames() throws JMSException {
+            return null;
+        }
+
+        @Override
+        public void setBooleanProperty(String s, boolean b) throws JMSException {
+
+        }
+
+        @Override
+        public void setByteProperty(String s, byte b) throws JMSException {
+
+        }
+
+        @Override
+        public void setShortProperty(String s, short i) throws JMSException {
+
+        }
+
+        @Override
+        public void setIntProperty(String s, int i) throws JMSException {
+
+        }
+
+        @Override
+        public void setLongProperty(String s, long l) throws JMSException {
+
+        }
+
+        @Override
+        public void setFloatProperty(String s, float v) throws JMSException {
+
+        }
+
+        @Override
+        public void setDoubleProperty(String s, double v) throws JMSException {
+
+        }
+
+        @Override
+        public void setStringProperty(String s, String s1) throws JMSException {
+
+        }
+
+        @Override
+        public void setObjectProperty(String s, Object o) throws JMSException {
+
+        }
+
+        @Override
+        public void acknowledge() throws JMSException {
+
+        }
+
+        @Override
+        public void clearBody() throws JMSException {
+
+        }
+    }
+
+    private EnhancedInstance enhancedInstance = new EnhancedInstance() {
+        @Override
+        public Object getSkyWalkingDynamicField() {
+            return "localhost:60601";
+        }
+
+        @Override
+        public void setSkyWalkingDynamicField(Object value) {
+        }
+    };
+
+
+    @Before
+    public void setUp() {
+        producerInterceptor = new ActiveMQProducerInterceptor();
+        mqDestination = new MQDestination();
+        mqDestination.setPhysicalName("test");
+        message = new Msg();
+        arguments = new Object[] {mqDestination, message};
+        argumentType = new Class[] {ActiveMQMessageProducer.class};
+
+    }
+
+    @Test
+    public void testSendMessage() throws Throwable {
+        producerInterceptor.beforeMethod(enhancedInstance, null, arguments, null, null);
+        producerInterceptor.afterMethod(enhancedInstance, null, arguments, null, null);
+
+        List<TraceSegment> traceSegmentList = segmentStorage.getTraceSegments();
+        assertThat(traceSegmentList.size(), is(1));
+
+        TraceSegment segment = traceSegmentList.get(0);
+        List<AbstractTracingSpan> spans = SegmentHelper.getSpans(segment);
+        assertThat(spans.size(), is(1));
+        assertMessageSpan(spans.get(0));
+    }
+
+    private void assertMessageSpan(AbstractTracingSpan span) {
+        SpanAssert.assertTag(span, 0, "localhost:60601");
+        SpanAssert.assertTag(span, 1, "test");
+        SpanAssert.assertComponent(span, ACTIVEMQ_PRODUCER);
+        SpanAssert.assertLayer(span, SpanLayer.MQ);
+        assertThat(span.getOperationName(), is("ActiveMQ/QUEUE/test/Producer"));
+    }
+}
diff --git a/apm-sniffer/apm-sdk-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/pom.xml
index 06a7b61a6..f18a16e65 100644
--- a/apm-sniffer/apm-sdk-plugin/pom.xml
+++ b/apm-sniffer/apm-sdk-plugin/pom.xml
@@ -57,6 +57,7 @@
         <module>servicecomb-plugin</module>
         <module>hystrix-1.x-plugin</module>
         <module>sofarpc-plugin</module>
+        <module>activemq-5.x-plugin</module>
     </modules>
     <packaging>pom</packaging>
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services