You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2016/05/24 16:07:15 UTC

[1/2] activemq-artemis git commit: ARTEMIS-536 Fix AMQP List/Sequence decoding

Repository: activemq-artemis
Updated Branches:
  refs/heads/master ecd9c1362 -> 82d833348


ARTEMIS-536 Fix AMQP List/Sequence decoding


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

Branch: refs/heads/master
Commit: d4038ec59aef58661ba952a0e6cb018e2842fcad
Parents: ecd9c13
Author: Martyn Taylor <mt...@redhat.com>
Authored: Tue May 24 12:17:18 2016 +0100
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue May 24 12:07:07 2016 -0400

----------------------------------------------------------------------
 .../converter/message/AMQPMessageTypes.java     | 25 ++++++++++++++++++++
 .../message/JMSMappingInboundTransformer.java   |  2 ++
 .../message/JMSMappingOutboundTransformer.java  | 13 +++++++++-
 3 files changed, 39 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d4038ec5/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/AMQPMessageTypes.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/AMQPMessageTypes.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/AMQPMessageTypes.java
new file mode 100644
index 0000000..2e67c4d
--- /dev/null
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/AMQPMessageTypes.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.core.protocol.proton.converter.message;
+
+public class AMQPMessageTypes {
+   public static final String AMQP_TYPE_KEY = "amqp:type";
+
+   public static final String AMQP_SEQUENCE = "amqp:sequence";
+
+   public static final String AMQP_LIST = "amqp:list";
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d4038ec5/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/JMSMappingInboundTransformer.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/JMSMappingInboundTransformer.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/JMSMappingInboundTransformer.java
index e804818..62eca7c 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/JMSMappingInboundTransformer.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/JMSMappingInboundTransformer.java
@@ -72,6 +72,7 @@ public class JMSMappingInboundTransformer extends InboundTransformer {
             m.writeObject(item);
          }
          rc = m;
+         m.setStringProperty(AMQPMessageTypes.AMQP_TYPE_KEY, AMQPMessageTypes.AMQP_SEQUENCE);
       }
       else if (body instanceof AmqpValue) {
          Object value = ((AmqpValue) body).getValue();
@@ -95,6 +96,7 @@ public class JMSMappingInboundTransformer extends InboundTransformer {
                m.writeObject(item);
             }
             rc = m;
+            m.setStringProperty(AMQPMessageTypes.AMQP_TYPE_KEY, AMQPMessageTypes.AMQP_LIST);
          }
          else if (value instanceof Map) {
             MapMessage m = vendor.createMapMessage();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d4038ec5/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 73dc42b..99fb7c3 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
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq.artemis.core.protocol.proton.converter.message;
 
+import org.apache.activemq.artemis.jms.client.ActiveMQMessage;
 import org.apache.qpid.proton.amqp.Binary;
 import org.apache.qpid.proton.amqp.Symbol;
 import org.apache.qpid.proton.amqp.UnsignedByte;
@@ -126,7 +127,14 @@ public class JMSMappingOutboundTransformer extends OutboundTransformer {
          }
          catch (MessageEOFException e) {
          }
-         body = new AmqpSequence(list);
+
+         String amqpType = msg.getStringProperty(AMQPMessageTypes.AMQP_TYPE_KEY);
+         if (amqpType.equals(AMQPMessageTypes.AMQP_LIST)) {
+            body = new AmqpValue(list);
+         }
+         else {
+            body = new AmqpSequence(list);
+         }
       }
       if (msg instanceof ObjectMessage) {
          body = new AmqpValue(((ObjectMessage) msg).getObject());
@@ -256,6 +264,9 @@ public class JMSMappingOutboundTransformer extends OutboundTransformer {
             String name = key.substring(prefixFooterKey.length());
             footerMap.put(name, msg.getObjectProperty(key));
          }
+         else if (key.equals(AMQPMessageTypes.AMQP_TYPE_KEY)) {
+            // skip
+         }
          else {
             if (apMap == null) {
                apMap = new HashMap();


[2/2] activemq-artemis git commit: This closes #533

Posted by cl...@apache.org.
This closes #533


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

Branch: refs/heads/master
Commit: 82d833348ea35f2feca3319d62d4ba6d944ef9db
Parents: ecd9c13 d4038ec
Author: Clebert Suconic <cl...@apache.org>
Authored: Tue May 24 12:07:08 2016 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue May 24 12:07:08 2016 -0400

----------------------------------------------------------------------
 .../converter/message/AMQPMessageTypes.java     | 25 ++++++++++++++++++++
 .../message/JMSMappingInboundTransformer.java   |  2 ++
 .../message/JMSMappingOutboundTransformer.java  | 13 +++++++++-
 3 files changed, 39 insertions(+), 1 deletion(-)
----------------------------------------------------------------------