Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-4361

MQTT subscription that fails auth leaves behind address and queue

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.26.0
    • None
    • MQTT
    • None

    Description

      When an MQTT client tries to create a subscription that is rejected due to auth failure an address and queue are created and left behind.

      For example, client ID client1 subscribes to # then the # address is created with a client1.# queue; this queue will quickly fill up with messages (as it captures all messages).

      MQTTSubscriptionManager::addSubscription() creates the queue for the subscription but createConsumerForSubscriptionQueue() call throws an ActiveMQSecurityException when auth rejected; the created queue is not then cleaned up.

      I'm using a wildcard address settings via config to cleanup these created queues, like this, but not a viable solution for all use cases:
       

      config.addAddressSetting(wildcardConfiguration.getAnyWordsString(),
      new AddressSettings()
      .setAutoDeleteCreatedQueues(true)
      .setAutoDeleteAddressesDelay(1)
      .setAutoDeleteQueuesMessageCount(-1L)
      );

      But this does not seem like good default behaviour as these leaked queues can quickly fill up with messages.

      Attachments

        Issue Links

          Activity

            People

              jbertram Justin Bertram
              richturner Rich T
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: