OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

mqtt-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [mqtt-comment] What happens if PUBREC is not matched to PUBLISH


Hi Takatoshi,

If you take the route of sending a PUBREL with a reason code of
"Packet Identifier not found" then the message flow can complete. If
you send a DISCONNECT then the client will be stuck trying to
reconnect, getting the same PUBREC each time.

The description of the "Packet Identifier not found" reason code
includes "This is not an error during recovery, but at other times
indicates a mismatch between the Session State on the Client and
Server", so you could argue that an incorrect PUBREC during a live
session would justify sending a DISCONNECT with protocol error reason
code. Personally I think I'd still just complete the message flow.

Regards,

Roger

On Wed, 4 Aug 2021 at 08:43, Takatoshi Kondo <redboltz@gmail.com> wrote:
>
> Hi,
>
> What is the correct behavior if the client (or broker) receives PUBREC
> packet but does not sent corresponding PUBLISH before ?
>
> Here is the scenario
>
> Pre condition. Client hasn't sent PUBLISH QoS2 Packet Identifier 1.
> 1. The client receives PUBREC Packet Identifier 1, Reason Code 0x00(Success)
>
> I guess it is a protocol error but I couldn't find the description
> about that in the spec
> https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html
>
> I found PUBREL reason code 0x92(Packet Identifier not found).
> https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901144
>
> Perhaps the client should send PUBREL with reason code 0x92?
> PUBCOMP has the same reason code too.
> https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901154
>
> So the expected behavior is as follows ?
>
> 1. The client receives PUBREC Packet Identifier 1, Reason Code 0x00(Success)
> 2. The client sends PUBREL Packet Identifier 1, Reason Code
> 0x92(Packet Identifier not found).
> 3. The broker sends PUBCOMP Packet Identifier 1, Reason Code
> 0x92(Packet Identifier not found) to the client.
>
> Is that correct?
>
> Or,
>
> 1. The client receives PUBREC Packet Identifier 1, Reason Code 0x00(Success)
> 2. The client sends DISCONNECT Packet with Reason Code 0x82(Protocol error)
>
> Any ideas?
>
> ----
> Thanks,
> Takatoshi
>
> --
> This publicly archived list offers a means to provide input to the
> OASIS Message Queuing Telemetry Transport (MQTT) TC.
>
> In order to verify user consent to the Feedback License terms and
> to minimize spam in the list archive, subscription is required
> before posting.
>
> Subscribe: mqtt-comment-subscribe@lists.oasis-open.org
> Unsubscribe: mqtt-comment-unsubscribe@lists.oasis-open.org
> List help: mqtt-comment-help@lists.oasis-open.org
> List archive: http://lists.oasis-open.org/archives/mqtt-comment/
> Feedback License: http://www.oasis-open.org/who/ipr/feedback_license.pdf
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
> Committee: http://www.oasis-open.org/committees/mqtt
> Join OASIS: http://www.oasis-open.org/join/
>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]