You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2019/04/17 20:46:45 UTC

[GitHub] [activemq-artemis] tabish121 commented on a change in pull request #2627: ARTEMIS-2311 Dealing with Protocol conversions and JMSReplyTo

tabish121 commented on a change in pull request #2627: ARTEMIS-2311 Dealing with Protocol conversions and JMSReplyTo
URL: https://github.com/apache/activemq-artemis/pull/2627#discussion_r276426986
 
 

 ##########
 File path: artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/AmqpCoreConverter.java
 ##########
 @@ -324,7 +327,26 @@ private static ServerJMSMessage processProperties(ServerJMSMessage jms, Properti
             jms.setJMSType(properties.getSubject());
          }
          if (properties.getReplyTo() != null) {
-            jms.setJMSReplyTo(new ServerDestination(properties.getReplyTo()));
+            Byte value = (Byte)(annotations != null ? annotations.getValue().get(AMQPMessageSupport.JMS_REPLY_TO_TYPE_MSG_ANNOTATION) : AMQPMessageSupport.QUEUE_TYPE);
+
+
+            switch (value) {
+               case AMQPMessageSupport.QUEUE_TYPE:
+                  org.apache.activemq.artemis.reader.MessageUtil.setJMSReplyTo(jms.getInnerMessage(), ActiveMQDestination.QUEUE_QUALIFIED_PREFIX + properties.getReplyTo());
+                  break;
+               case AMQPMessageSupport.TEMP_QUEUE_TYPE:
+                  org.apache.activemq.artemis.reader.MessageUtil.setJMSReplyTo(jms.getInnerMessage(), ActiveMQDestination.TEMP_QUEUE_QUALIFED_PREFIX + properties.getReplyTo());
+                  break;
+               case AMQPMessageSupport.TOPIC_TYPE:
+                  org.apache.activemq.artemis.reader.MessageUtil.setJMSReplyTo(jms.getInnerMessage(), ActiveMQDestination.TOPIC_QUALIFIED_PREFIX + properties.getReplyTo());
+                  break;
+               case AMQPMessageSupport.TEMP_TOPIC_TYPE:
+                  org.apache.activemq.artemis.reader.MessageUtil.setJMSReplyTo(jms.getInnerMessage(), ActiveMQDestination.TEMP_TOPIC_QUALIFED_PREFIX + properties.getReplyTo());
+                  break;
+               default: // in theory this should never happen
 
 Review comment:
   Why would this never happen in theory, AMQP messages can have message annotations and also use a reply to value and NOT be from a JMS type client.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services