activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject activemq git commit: [AMQ-6645] add originalDestination to the mapped properties
Date Tue, 04 Apr 2017 14:04:08 GMT
Repository: activemq
Updated Branches:
  refs/heads/master 729766e49 -> 4a3d117d9


[AMQ-6645] add originalDestination to the mapped properties


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/4a3d117d
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/4a3d117d
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/4a3d117d

Branch: refs/heads/master
Commit: 4a3d117d9693480c4a6564dc2c349317d16a14b3
Parents: 729766e
Author: gtully <gary.tully@gmail.com>
Authored: Tue Apr 4 15:03:54 2017 +0100
Committer: gtully <gary.tully@gmail.com>
Committed: Tue Apr 4 15:03:54 2017 +0100

----------------------------------------------------------------------
 .../activemq/console/filter/MapTransformFilter.java       |  4 +++-
 .../activemq/console/filter/TestMapTransformFilter.java   | 10 ++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/4a3d117d/activemq-console/src/main/java/org/apache/activemq/console/filter/MapTransformFilter.java
----------------------------------------------------------------------
diff --git a/activemq-console/src/main/java/org/apache/activemq/console/filter/MapTransformFilter.java
b/activemq-console/src/main/java/org/apache/activemq/console/filter/MapTransformFilter.java
index 99b9780..f0440d4 100644
--- a/activemq-console/src/main/java/org/apache/activemq/console/filter/MapTransformFilter.java
+++ b/activemq-console/src/main/java/org/apache/activemq/console/filter/MapTransformFilter.java
@@ -265,7 +265,9 @@ public class MapTransformFilter extends ResultTransformFilter {
         if (msg.getJMSType() != null) {
             props.put(AmqMessagesUtil.JMS_MESSAGE_HEADER_PREFIX + "JMSType", msg.getJMSType());
         }
-
+        if (msg.getOriginalDestination() != null) {
+            props.put(AmqMessagesUtil.JMS_MESSAGE_CUSTOM_PREFIX + "OriginalDestination",
msg.getOriginalDestination().getPhysicalName());
+        }
         // Get custom properties
         Enumeration e = msg.getPropertyNames();
         while (e.hasMoreElements()) {

http://git-wip-us.apache.org/repos/asf/activemq/blob/4a3d117d/activemq-console/src/test/java/org/apache/activemq/console/filter/TestMapTransformFilter.java
----------------------------------------------------------------------
diff --git a/activemq-console/src/test/java/org/apache/activemq/console/filter/TestMapTransformFilter.java
b/activemq-console/src/test/java/org/apache/activemq/console/filter/TestMapTransformFilter.java
index 6c6818c..989e4cc 100644
--- a/activemq-console/src/test/java/org/apache/activemq/console/filter/TestMapTransformFilter.java
+++ b/activemq-console/src/test/java/org/apache/activemq/console/filter/TestMapTransformFilter.java
@@ -17,6 +17,9 @@
 package org.apache.activemq.console.filter;
 
 import junit.framework.TestCase;
+import org.apache.activemq.command.ActiveMQMessage;
+import org.apache.activemq.command.ActiveMQQueue;
+import org.apache.activemq.console.util.AmqMessagesUtil;
 
 public class TestMapTransformFilter extends TestCase {
 
@@ -55,4 +58,11 @@ public class TestMapTransformFilter extends TestCase {
         }
     }
 
+    public void testOriginaDest() throws Exception {
+        MapTransformFilter filter = new MapTransformFilter(null);
+        ActiveMQMessage mqMessage = new ActiveMQMessage();
+        mqMessage.setOriginalDestination(new ActiveMQQueue("O"));
+        assertTrue(filter.transformToMap(mqMessage).containsKey(AmqMessagesUtil.JMS_MESSAGE_CUSTOM_PREFIX
+ "OriginalDestination"));
+    }
+
 }


Mime
View raw message