[ 
https://issues.apache.org/jira/browse/ARTEMIS-3113?focusedWorklogId=550872&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-550872
 ]

ASF GitHub Bot logged work on ARTEMIS-3113:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 10/Feb/21 19:31
            Start Date: 10/Feb/21 19:31
    Worklog Time Spent: 10m 
      Work Description: michaelandrepearce commented on a change in pull 
request #3448:
URL: https://github.com/apache/activemq-artemis/pull/3448#discussion_r574015555



##########
File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/jms/ServerJMSMessage.java
##########
@@ -137,226 +131,178 @@ public final String getJMSCorrelationID() throws 
JMSException {
       }
    }
 
-   @Override
-   public final void setJMSCorrelationID(String correlationID) throws 
JMSException {
+   public final void setJMSCorrelationID(String correlationID) throws 
Exception {
       message.setCorrelationID(correlationID);
    }
 
-   @Override
-   public final Destination getJMSReplyTo() throws JMSException {
-      SimpleString reply = MessageUtil.getJMSReplyTo(message);
-      if (reply != null) {
-         return ActiveMQDestination.fromPrefixedName(reply.toString());
-      } else {
-         return null;
-      }
+   public final SimpleString getJMSReplyTo() throws Exception {
+      return MessageUtil.getJMSReplyTo(message);
    }
 
-   @Override
-   public final void setJMSReplyTo(Destination replyTo) throws JMSException {
-      MessageUtil.setJMSReplyTo(message, replyTo == null ? null : 
((ActiveMQDestination) replyTo).getSimpleAddress());
+   public final void setJMSReplyTo(String replyTo) throws Exception {
+      MessageUtil.setJMSReplyTo(message, SimpleString.toSimpleString(replyTo));
    }
 
-   @Override
-   public Destination getJMSDestination() throws JMSException {
-      return ActiveMQDestination.createDestination(message.getRoutingType(), 
message.getAddressSimpleString());
+   public SimpleString getJMSDestination() throws Exception {
+      return message.getAddressSimpleString();
    }
 
-   @Override
-   public final void setJMSDestination(Destination destination) throws 
JMSException {
-      if (destination == null) {
-         message.setAddress((SimpleString) null);
-      } else {
-         message.setAddress(((ActiveMQDestination) 
destination).getSimpleAddress());
-      }
-
+   public final void setJMSDestination(String destination) throws Exception {
+      message.setAddress(destination);
    }
 
-   @Override
-   public final int getJMSDeliveryMode() throws JMSException {
-      return message.isDurable() ? DeliveryMode.PERSISTENT : 
DeliveryMode.NON_PERSISTENT;
+   public final int getJMSDeliveryMode() throws Exception {
+      return message.isDurable() ? DeliveryMode_PERSISTENT : 
DeliveryMode_NON_PERSISTENT;
    }
 
-   @Override
-   public final void setJMSDeliveryMode(int deliveryMode) throws JMSException {
-      if (deliveryMode == DeliveryMode.PERSISTENT) {
-         message.setDurable(true);
-      } else if (deliveryMode == DeliveryMode.NON_PERSISTENT) {
-         message.setDurable(false);
-      } else {
-         throw new JMSException("Invalid mode " + deliveryMode);
+   public final void setJMSDeliveryMode(int deliveryMode) throws Exception {
+      switch (deliveryMode) {
+         case DeliveryMode_PERSISTENT:
+            message.setDurable(true);
+            break;
+         case DeliveryMode_NON_PERSISTENT:
+            message.setDurable(false);
+            break;
+         default:
+            throw new Exception("Invalid mode " + deliveryMode);

Review comment:
       -1 throwing raw exception.




----------------------------------------------------------------
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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 550872)
    Time Spent: 2h 20m  (was: 2h 10m)

> Artemis AMQP shouldn't depend on JMS
> ------------------------------------
>
>                 Key: ARTEMIS-3113
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3113
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: AMQP
>    Affects Versions: 2.16.0
>            Reporter: Emmanuel Hugonnet
>            Priority: Major
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> The converters between core messages and amqp messages depend on JMS. Since 
> this is just for convenience we should remove this dependecy on an API that 
> is being replaced.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to