[AMQ-6645] add originalDestination to the mapped properties

This commit is contained in:
gtully 2017-04-04 15:03:54 +01:00
parent 729766e492
commit 4a3d117d96
2 changed files with 13 additions and 1 deletions

View File

@ -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()) {

View File

@ -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"));
}
}