Hi Philip,
In the section 3.3.1.3 where the [MQTT-3.3.1-9] requirement is
described, this paragraph precedes the list of requirements:
> When a new Non‑shared Subscription is made, the last retained message, if any, on each matching topic name is sent
> to the Client as directed by the Retain Handling Subscription Option. These messages are sent with the RETAIN flag set
> to 1. Which retained messages are sent is controlled by the Retain Handling Subscription Option. At the time of the Subscription:
This makes it clear to me that [MQTT-3.3.1-9] only applies when a
subscription is being made, not in direct response to a PUBLISH.
I believe the intent of the spec is that once a message is accepted as
a retained message, the original client is no longer considered to be
the publishing client, hence if it made a later subscription that
matched that retain message it would still expect to receive it. In
other words, the [MQTT-3.8.3-3] only applies to live connections. I
don't believe that is written down, but it goes hand in hand with the
decoupled nature.
Having said that, some people contend that there is a security issue
here. For example, if a client publishes a retained message and at a
later point its authorisation to publish to that topic is removed, the
contention is that this retained message should no longer be published
to new subscribers. This means that keeping the association between a
retained message and the originating client id is required, which
confuses the point above.
Mosquitto does have the capability to record the originating client in
retained messages, but does not consider that when sending retained
messages on a subscribe. In other words it obeys [MQTT-3.3.1-9].
Regards,
Roger
> --
> To learn more about MQTT see
https://mqtt.org
> ---
> You received this message because you are subscribed to the Google Groups "MQTT" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
mqtt+uns...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/mqtt/CANWftzK6hwsaTNV8z4EZLSvW5j%2BWuUP3V87RacznxXEOGxjM0w%40mail.gmail.com.