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


##########
artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSubscriptionManager.java:
##########
@@ -146,20 +147,20 @@ synchronized void stop() throws Exception {
       }
    }
 
-   private Queue createQueueForSubscription(String rawTopicName, String 
parsedTopicName) throws Exception {
+   private Queue createQueueForSubscription(String rawTopicName, String 
parsedTopicName, boolean isFullyQualified) throws Exception {
       String coreAddress = 
MQTTUtil.getCoreAddressFromMqttTopic(parsedTopicName, 
session.getWildcardConfiguration());
       String coreQueue = MQTTUtil.getCoreQueueFromMqttTopic(rawTopicName, 
session.getState().getClientId(), session.getWildcardConfiguration());
 
-      // check to see if a subscription queue already exists.
+      // check to see if a subscription queue already exists
       Queue q = session.getServer().locateQueue(coreQueue);
 
-      // The queue does not exist so we need to create it.
+      // the subscription queue does not exist so we need to create it
       if (q == null) {
          SimpleString sAddress = SimpleString.toSimpleString(coreAddress);
 
-         // Check we can auto create queues.
+         // only check if we can auto create queues if it's FQQN
          BindingQueryResult bindingQueryResult = 
session.getServerSession().executeBindingQuery(sAddress);
-         if (!bindingQueryResult.isAutoCreateQueues()) {
+         if (!bindingQueryResult.isAutoCreateQueues() && isFullyQualified) {

Review Comment:
   To align to the comment, it should check the isFullyQualified variable 
first, rather than _always_ calling the isAutoCreateQueues() method regardless 
of its value as it currently is.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to