weixin_39722921 2020-11-29 12:13
浏览 0

testClientSubscribeAfterRetainedQoS0IsSent may be in error

I believe testClientSubscribeAfterRetainedQoS0IsSent is in error.

a message sent with QOS=0 and retain=true SHOULD be delivered to a client which subscribes after the publish is sent.

该提问来源于开源项目:moquette-io/moquette

  • 写回答

4条回答 默认 最新

  • weixin_39722921 2020-11-29 12:13
    关注

    From the 3.1.1 spec:

    "It SHOULD store the new QoS 0 message as the new retained message for that topic, but MAY choose to discard it at any time - if this happens there will be no retained message for that topic"

    So technically moquette is exercising the "may" option and discarding it ?

    Previously I had been publishing QOS=1, and this was saving too many unneeded messages and basically bloating the persistence database. But after downshifting to QOS=0, I'm finding the messages simply dropped. I would prefer if these message were stored.

    In the language of the RFC: https://www.ietf.org/rfc/rfc2119.txt

    SHOULD is listed more strongly than MAY.

    评论

报告相同问题?