activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject activemq git commit: https://issues.apache.org/jira/browse/AMQ-5684
Date Fri, 27 Mar 2015 22:59:53 GMT
Repository: activemq
Updated Branches:
  refs/heads/master efc9a8d57 -> af1329291


https://issues.apache.org/jira/browse/AMQ-5684

Whem possible restore the orignal MessageId value from the incoming
message.

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

Branch: refs/heads/master
Commit: af1329291687d4aed4755d67e4e7bcf640c2a3e1
Parents: efc9a8d
Author: Timothy Bish <tabish121@gmail.com>
Authored: Fri Mar 27 18:59:34 2015 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Fri Mar 27 18:59:34 2015 -0400

----------------------------------------------------------------------
 .../amqp/message/JMSMappingOutboundTransformer.java      | 11 ++++++++++-
 .../transport/amqp/interop/AmqpSendReceiveTest.java      |  4 +---
 2 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/af132929/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/JMSMappingOutboundTransformer.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/JMSMappingOutboundTransformer.java
b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/JMSMappingOutboundTransformer.java
index e9b24cc..b215f80 100644
--- a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/JMSMappingOutboundTransformer.java
+++ b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/JMSMappingOutboundTransformer.java
@@ -39,6 +39,8 @@ import javax.jms.TemporaryTopic;
 import javax.jms.TextMessage;
 import javax.jms.Topic;
 
+import org.apache.activemq.command.ActiveMQMessage;
+import org.apache.activemq.command.MessageId;
 import org.apache.qpid.proton.amqp.Binary;
 import org.apache.qpid.proton.amqp.Symbol;
 import org.apache.qpid.proton.amqp.UnsignedByte;
@@ -174,7 +176,14 @@ public class JMSMappingOutboundTransformer extends OutboundTransformer
{
             props.setSubject(msg.getJMSType());
         }
         if (msg.getJMSMessageID() != null) {
-            props.setMessageId(msg.getJMSMessageID());
+            ActiveMQMessage amqMsg = (ActiveMQMessage) msg;
+
+            MessageId msgId = amqMsg.getMessageId();
+            if (msgId.getTextView() != null) {
+                props.setMessageId(msgId.getTextView());
+            } else {
+                props.setMessageId(msgId.toString());
+            }
         }
         if (msg.getJMSDestination() != null) {
             props.setTo(vendor.toAddress(msg.getJMSDestination()));

http://git-wip-us.apache.org/repos/asf/activemq/blob/af132929/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
index b16ef59..e7058e5 100644
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
@@ -28,7 +28,6 @@ import org.apache.activemq.transport.amqp.client.AmqpMessage;
 import org.apache.activemq.transport.amqp.client.AmqpReceiver;
 import org.apache.activemq.transport.amqp.client.AmqpSender;
 import org.apache.activemq.transport.amqp.client.AmqpSession;
-import org.junit.Ignore;
 import org.junit.Test;
 
 /**
@@ -36,7 +35,6 @@ import org.junit.Test;
  */
 public class AmqpSendReceiveTest extends AmqpClientTestSupport {
 
-    @Ignore("Test fails when JMS transformer is in play")
     @Test(timeout = 60000)
     public void testCloseBusyReceiver() throws Exception {
         final int MSG_COUNT = 20;
@@ -71,7 +69,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport {
         AmqpReceiver receiver2 = session.createReceiver("queue://" + getTestName());
         receiver2.flow(200);
         for (int i = 0; i < MSG_COUNT; ++i) {
-            received = receiver1.receive(5, TimeUnit.SECONDS);
+            received = receiver2.receive(5, TimeUnit.SECONDS);
             assertEquals("msg" + i, received.getMessageId());
         }
 


Mime
View raw message