You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/06/02 19:40:00 UTC

[jira] [Work logged] (ARTEMIS-3851) MQTT subscription queues exist after restart despite CleanSession=1

     [ https://issues.apache.org/jira/browse/ARTEMIS-3851?focusedWorklogId=777806&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-777806 ]

ASF GitHub Bot logged work on ARTEMIS-3851:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Jun/22 19:39
            Start Date: 02/Jun/22 19:39
    Worklog Time Spent: 10m 
      Work Description: jbertram opened a new pull request, #4103:
URL: https://github.com/apache/activemq-artemis/pull/4103

   MQTT 3.1 and 3.1.1 clients using a clean session should have a
   *non-durable* subscription queue. If the broker restarts the queue
   should be removed. This is due to [MQTT-3.1.2-6] which states that the
   session (and any state) must last only as long as the network
   connection.




Issue Time Tracking
-------------------

            Worklog Id:     (was: 777806)
    Remaining Estimate: 0h
            Time Spent: 10m

> MQTT subscription queues exist after restart despite CleanSession=1
> -------------------------------------------------------------------
>
>                 Key: ARTEMIS-3851
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3851
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Justin Bertram
>            Assignee: Justin Bertram
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> MQTT subscription queues are not cleaned up if the broker goes down while the consumer is connected.
> To reproduce the issue:
> # Run AMQ broker with standard configuration (addresses and queues are auto-created)
> # Run a MQTT consumer connecting to the target topic with {{CleanSession=true}}. At this point a subscription queue will be created on the address for the MQTT topic.
> # Run a MQTT producer sending messages into the target topic.
> # Since the producer is running, the consumer is receiving the messages.
> # Shutdown AMQ (it can be done gracefully or by killing -9 it).
> # Stop the MQTT producer.
> # Stop the MQTT consumer
> # Start the broker. After it is restarted, the old queue associated to the MQTT consumer is still there and it's not deleted.
> # Run again the MQTT producer. The broker continues enqueuing messages into the old subscription queue.
> # Stop the MQTT producer. The queue stops growing but it's still there with messages inside.
> The MQTT 3.1.1 specification states in [section 3.1.2.4|http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718030]:
> bq. If CleanSession is set to 1, the Client and Server MUST discard any previous Session and start a new one. This Session lasts as long as the Network Connection. State data associated with this Session MUST NOT be reused in any subsequent Session [MQTT-3.1.2-6].
> When the broker is stopped the network connection is terminated so the session's state data (including any messages for any subscriptions) should be removed.
> To be clear, this works differently in MQTT 5 where {{CleanSession}} became {{CleanStart}} and session expiry interval was added.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)