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
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
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.