You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by an...@apache.org on 2016/07/14 09:09:20 UTC

[1/2] activemq-artemis git commit: This closes #631 ARTEMIS-629 Preserve the correlation ID type during conversions

Repository: activemq-artemis
Updated Branches:
  refs/heads/master 1893d773a -> d7edf0668


This closes #631 ARTEMIS-629 Preserve the correlation ID type during conversions


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

Branch: refs/heads/master
Commit: d7edf06689aeed94a8bfc605c61a2c29c3f0ec35
Parents: 1893d77 688eac5
Author: Andy Taylor <an...@gmail.com>
Authored: Thu Jul 14 10:08:55 2016 +0100
Committer: Andy Taylor <an...@gmail.com>
Committed: Thu Jul 14 10:08:55 2016 +0100

----------------------------------------------------------------------
 .../proton/converter/message/InboundTransformer.java        | 2 +-
 .../converter/message/JMSMappingOutboundTransformer.java    | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[2/2] activemq-artemis git commit: ARTEMIS-629 Preserve the correlation ID type during conversions

Posted by an...@apache.org.
ARTEMIS-629 Preserve the correlation ID type during conversions

When converted to a core message type the original type of the
CorrelationId in the AMQP message is lost, we must encode the type to
prevent the loss of the original type as this value is meant to be
immutable.

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

Branch: refs/heads/master
Commit: 688eac50ea7f73eb366eced72753073cdd3535dc
Parents: 1893d77
Author: Timothy Bish <ta...@gmail.com>
Authored: Tue Jul 12 18:18:26 2016 -0400
Committer: Andy Taylor <an...@gmail.com>
Committed: Thu Jul 14 10:08:55 2016 +0100

----------------------------------------------------------------------
 .../proton/converter/message/InboundTransformer.java        | 2 +-
 .../converter/message/JMSMappingOutboundTransformer.java    | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/688eac50/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/InboundTransformer.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/InboundTransformer.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/InboundTransformer.java
index 71f75c4..9560ac1 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/InboundTransformer.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/InboundTransformer.java
@@ -215,7 +215,7 @@ public abstract class InboundTransformer {
             jms.setJMSReplyTo(vendor.createDestination(properties.getReplyTo()));
          }
          if (properties.getCorrelationId() != null) {
-            jms.setJMSCorrelationID(properties.getCorrelationId().toString());
+            jms.setJMSCorrelationID(AMQPMessageIdHelper.INSTANCE.toBaseMessageIdString(properties.getCorrelationId()));
          }
          if (properties.getContentType() != null) {
             jms.setStringProperty(prefixVendor + "ContentType", properties.getContentType().toString());

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/688eac50/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/JMSMappingOutboundTransformer.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/JMSMappingOutboundTransformer.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/JMSMappingOutboundTransformer.java
index 46dc269..a6ccfa9 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/JMSMappingOutboundTransformer.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/JMSMappingOutboundTransformer.java
@@ -176,7 +176,14 @@ public class JMSMappingOutboundTransformer extends OutboundTransformer {
          maMap.put(LEGACY_JMS_REPLY_TO_TYPE_MSG_ANNOTATION, destinationAttributes(msg.getJMSReplyTo()));
       }
       if (msg.getJMSCorrelationID() != null) {
-         props.setCorrelationId(msg.getJMSCorrelationID());
+         String correlationId = msg.getJMSCorrelationID();
+
+         try {
+            props.setCorrelationId(AMQPMessageIdHelper.INSTANCE.toIdObject(correlationId));
+         }
+         catch (ActiveMQAMQPIllegalStateException e) {
+            props.setCorrelationId(correlationId);
+         }
       }
       if (msg.getJMSExpiration() != 0) {
          long ttl = msg.getJMSExpiration() - System.currentTimeMillis();