qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject qpid-broker-j git commit: QPID-8030: [Broker-J] Message conversion from 0-8 to 1.0 should preserve binary correlationId
Date Wed, 06 Dec 2017 12:56:32 GMT
Repository: qpid-broker-j
Updated Branches:
  refs/heads/7.0.x dc6ce7fb9 -> 6747c7dbc


QPID-8030: [Broker-J] Message conversion from 0-8 to 1.0 should preserve binary correlationId

(cherry picked from commit e08052db31043b9c5ba13981c8778b668eb23448)


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/6747c7db
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/6747c7db
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/6747c7db

Branch: refs/heads/7.0.x
Commit: 6747c7dbcd14bfbe09d3702f59ce49994dc40349
Parents: dc6ce7f
Author: Lorenz Quack <lquack@apache.org>
Authored: Fri Nov 10 16:04:00 2017 +0000
Committer: Alex Rudyy <orudyy@apache.org>
Committed: Wed Dec 6 12:51:42 2017 +0000

----------------------------------------------------------------------
 .../v0_8_v1_0/MessageConverter_0_8_to_1_0.java         | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/6747c7db/broker-plugins/amqp-msg-conv-0-8-to-1-0/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v1_0/MessageConverter_0_8_to_1_0.java
----------------------------------------------------------------------
diff --git a/broker-plugins/amqp-msg-conv-0-8-to-1-0/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v1_0/MessageConverter_0_8_to_1_0.java
b/broker-plugins/amqp-msg-conv-0-8-to-1-0/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v1_0/MessageConverter_0_8_to_1_0.java
index 32a076c..6839993 100644
--- a/broker-plugins/amqp-msg-conv-0-8-to-1-0/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v1_0/MessageConverter_0_8_to_1_0.java
+++ b/broker-plugins/amqp-msg-conv-0-8-to-1-0/src/main/java/org/apache/qpid/server/protocol/converter/v0_8_v1_0/MessageConverter_0_8_to_1_0.java
@@ -21,6 +21,8 @@
 package org.apache.qpid.server.protocol.converter.v0_8_v1_0;
 
 import java.net.URISyntaxException;
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
 import java.util.Date;
 import java.util.LinkedHashMap;
 import java.util.Map;
@@ -88,7 +90,16 @@ public class MessageConverter_0_8_to_1_0 extends MessageConverter_to_1_0<AMQMess
         final AMQShortString correlationId = contentHeader.getCorrelationId();
         if(correlationId != null)
         {
-            props.setCorrelationId(correlationId.toString());
+            final byte[] correlationIdAsBytes = correlationId.getBytes();
+            final String correlationIdAsString = contentHeader.getCorrelationIdAsString();
+            if (Arrays.equals(correlationIdAsBytes, correlationIdAsString.getBytes(StandardCharsets.UTF_8)))
+            {
+                props.setCorrelationId(correlationIdAsString);
+            }
+            else
+            {
+                props.setCorrelationId(correlationIdAsBytes);
+            }
         }
 
         final AMQShortString messageId = contentHeader.getMessageId();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message