mirror of https://github.com/apache/activemq.git
[AMQ-6645] add originalDestination to the mapped properties
This commit is contained in:
parent
729766e492
commit
4a3d117d96
|
@ -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()) {
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue