clebertsuconic commented on a change in pull request #2520: ARTEMIS-2238 
Enhancement to queueQuery on producer
URL: https://github.com/apache/activemq-artemis/pull/2520#discussion_r251086218
 
 

 ##########
 File path: 
artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageProducer.java
 ##########
 @@ -393,57 +395,18 @@ private void doSendx(ActiveMQDestination destination,
          if (defaultDestination == null) {
             throw new UnsupportedOperationException("Destination must be 
specified on send with an anonymous producer");
          }
-
          destination = defaultDestination;
-      } else {
-         if (defaultDestination != null) {
-            if (!destination.equals(defaultDestination)) {
-               throw new UnsupportedOperationException("Where a default 
destination is specified " + "for the sender and a destination is " + 
"specified in the arguments to the send, " + "these destinations must be 
equal");
-            }
+      } else if (defaultDestination != null) {
+         if (!destination.equals(defaultDestination)) {
+            throw new UnsupportedOperationException("Where a default 
destination is specified " + "for the sender and a destination is " + 
"specified in the arguments to the send, " + "these destinations must be 
equal");
          }
+      } else {
+         session.checkDestination(destination);
 
          address = destination.getSimpleAddress();
 
 Review comment:
   Those lines are the reason why I wanted to run a full testsuite before 
merging this.
   
   And I think you're right...
   
   
   
   I'm adding a commit to be squashed into yours. I will squash it before 
merging it, but if you could review it please

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


With regards,
Apache Git Services

Reply via email to