activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andytay...@apache.org
Subject [2/2] activemq-artemis git commit: ARTEMIS-629 Preserve the correlation ID type during conversions
Date Thu, 14 Jul 2016 09:09:21 GMT
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 <tabish121@gmail.com>
Authored: Tue Jul 12 18:18:26 2016 -0400
Committer: Andy Taylor <andy.tayls67@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();


Mime
View raw message