gemmellr commented on code in PR #4502:
URL: https://github.com/apache/activemq-artemis/pull/4502#discussion_r1221772944


##########
artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java:
##########
@@ -928,6 +917,35 @@ private ActiveMQMessageConsumer createConsumer(final 
ActiveMQDestination dest,
       }
    }
 
+   private SimpleString createFullyQualifedNamedQueue(ActiveMQDestination dest,
+                                        SimpleString coreFilterString,
+                                        AddressQuery response) throws 
ActiveMQException, JMSException {
+      SimpleString queueName;
+      queueName = CompositeAddress.extractQueueName(dest.getSimpleAddress());
+      if (!response.isExists() || 
!response.getQueueNames().contains(AutoCreateUtil.getCoreQueueName(session, 
dest.getSimpleAddress()))) {
+         if (response.isAutoCreateQueues()) {
+            try {
+               createQueue(dest, RoutingType.MULTICAST, 
dest.getSimpleAddress(), coreFilterString, true, true, response);
+            } catch (ActiveMQQueueExistsException e) {
+               // The queue was created by another client/admin between the 
query check and send create queue packet
+            }
+         } else {
+            throw new InvalidDestinationException("Destination " + 
dest.getName() + " does not exist");
+         }
+      } else {
+         QueueQuery queueQuery = session.queueQuery(queueName);
+
+         if (!queueQuery.isExists()) {
+            throw new InvalidDestinationException("Destination " + queueName + 
" does not exist");
+         }
+
+         if (coreFilterString != null && 
!queueQuery.getFilterString().equals(coreFilterString)) {

Review Comment:
   Though I guess at least, it might only be a case of adding a toggle later if 
this is actually an issue for anyone...



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to