[
https://issues.apache.org/jira/browse/ARTEMIS-4760?focusedWorklogId=921953&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-921953
]
ASF GitHub Bot logged work on ARTEMIS-4760:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 04/Jun/24 11:24
Start Date: 04/Jun/24 11:24
Worklog Time Spent: 10m
Work Description: 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.
Issue Time Tracking
-------------------
Worklog Id: (was: 921953)
Time Spent: 20m (was: 10m)
> Creating MQTT consumer should work if auto-create-queues is false
> -----------------------------------------------------------------
>
> Key: ARTEMIS-4760
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4760
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Reporter: Justin Bertram
> Assignee: Justin Bertram
> Priority: Major
> Time Spent: 20m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact