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

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

                Author: ASF GitHub Bot
            Created on: 07/Jun/22 17:01
            Start Date: 07/Jun/22 17:01
    Worklog Time Spent: 10m 
      Work Description: clebertsuconic commented on PR #4103:
URL: 
https://github.com/apache/activemq-artemis/pull/4103#issuecomment-1148933232

   @jbertram there's a test failure introduced by this PR:
   
   
org.apache.activemq.artemis.tests.integration.mqtt.PahoMQTTQOS2SecurityTest.testSendAndReceiveMQTT




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

    Worklog Id:     (was: 779190)
    Time Spent: 20m  (was: 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: 20m
>  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)

Reply via email to