persisting retained messages

16 views
Skip to first unread message

Zvi

unread,
Feb 14, 2012, 4:56:53 PM2/14/12
to MQ Telemetry Transport
Hi,

The spec says: "Retained messages should be kept over restarts of the
server."
But it also says, that QoS = 0 is "Fire and Forget".

I interpret it as: "message published with QoS are not guaranteed to
be delivered to subscribers, but in case it hit broker, it should be
persisted to non-volatile memory or database".

It seems a little bit harsh, since broker may run for months without
restarts and storing messages with QoS=0 in memory should be OK. I
don't see it as it as a big deal if "Last Known Good" value will be
lost, the new one will be generated after server restarts.
If somebody want their retained values to persist, maybe he/she should
use QoS>0 ?

Alternatively there are should be option in PUBLISH request, to
specify if retained message should be persisted or not (one additional
bit).
Can we add this to the next MQTT spec revision?

BR,
Zvi

Zvi

unread,
Feb 14, 2012, 5:00:01 PM2/14/12
to MQ Telemetry Transport


On Feb 14, 11:56 pm, Zvi <zvi.avra...@gmail.com> wrote:
> Hi,
>
> The spec says: "Retained messages should be kept over restarts of the
> server."
> But it also says, that QoS = 0 is "Fire and Forget".
>
> I interpret it as: "message published with QoS are not guaranteed to
> be delivered to subscribers, but in case it hit broker, it should be
> persisted to non-volatile memory or database".

correction, should read as: "message published with QoS = 0 ..."

Nicholas O'Leary

unread,
Feb 14, 2012, 5:54:28 PM2/14/12
to mq...@googlegroups.com
HI Zvi,

I may be misreading your post, but I think you are suggesting that QoS
0 retained messages do not need to be persisted - or that an
additional flag could be added to indicate whether a retained message
should be persisted or not.

Is that right?

Regards,
Nick

> --
> To learn more about MQTT please visit http://mqtt.org
>
> To post to this group, send email to mq...@googlegroups.com
> To unsubscribe from this group, send email to
> mqtt+uns...@googlegroups.com
>
> For more options, visit this group at
> http://groups.google.com/group/mqtt

Zvi

unread,
Feb 14, 2012, 6:27:45 PM2/14/12
to MQ Telemetry Transport
correct

On Feb 15, 12:54 am, "Nicholas O'Leary" <nick.ole...@gmail.com> wrote:
> HI Zvi,
>
> I may be misreading your post, but I think you are suggesting that QoS
> 0 retained messages do not need to be persisted - or that an
> additional flag could be added to indicate whether a retained message
> should be persisted or not.
>
> Is that right?
>
> Regards,
> Nick
>
> On 14 February 2012 22:00, Zvi <zvi.avra...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
> > On Feb 14, 11:56 pm, Zvi <zvi.avra...@gmail.com> wrote:
> >> Hi,
>
> >> The spec says: "Retained messages should be kept over restarts of the
> >> server."
> >> But it also says, that QoS = 0 is "Fire and Forget".
>
> >> I interpret it as: "message published with QoS are not guaranteed to
> >> be delivered to subscribers, but in case it hit broker, it should be
> >> persisted to non-volatile memory or database".
>
> > correction, should read as: "message published with QoS = 0 ..."
>
> >> It seems a little bit harsh, since broker may run for months without
> >> restarts and storing messages with QoS=0 in memory should be OK. I
> >> don't see it as it as a big deal if "Last Known Good" value will be
> >> lost, the new one will be generated after server restarts.
> >> If somebody want their retained values to persist, maybe he/she should
> >> use QoS>0 ?
>
> >> Alternatively there are should be option in PUBLISH request, to
> >> specify if retained message should be persisted or not (one additional
> >> bit).
> >> Can we add this to the next MQTT spec revision?
>
> >> BR,
> >> Zvi
>
> > --
> > To learn more about MQTT please visithttp://mqtt.org
Reply all
Reply to author
Forward
0 new messages