0
votes

I am using MQTT V5 in my project and I have a business requirement as follows:

“Publisher shall receive acknowledgment from the subscribers confirming that they have successfully received the publisher’s message”.

Notice that this IS NOT AT ALL the same requirement satisfied by the MQTT request/response pattern introduced in MQTT V5. My publisher DOES NOT need a traditional proper response with data in it. My publisher only needs a receipt acknowledgment to know that its message was received by the subscribers. That’s it, the lighter the communication packets are the better it is for me.

I read the following article: https://www.emqx.io/blog/introduction-to-mqtt-qos

which includes the following sequence diagram for QoS 2:

MQTT QoS 2 sequence diagram

I fully understand the acknowledgment sequence when there is only one subscriber as shown in the diagram.

My questions are:

In the case where there are multiple subscribers to the publisher’s topic, ALL of them with QoS 2 subscriptions:

1 - will my publisher receive one PUBCOMP acknowledgment for each subscriber? In another words, will my publisher receive multiple PUBCOMP acks from the broker.

2 - or will the broker send only one PUBCOMP message to my publisher only after it has successfully received PUBCOMP acknowledgments from ALL subscribers? In another words, will the broker send only one PUBCOMP ack to my publisher only after it has successfully delivered the message to all subscribers?

Thanks in advance for you attention to this question.

1

1 Answers

0
votes

High QOS is only between one client and the broker at a time, not end to end delivery.

That diagram breaks down if there is an offline client with a persistent subscription to a matching topic. If that was the case with the given diagram then the client would not receive PUBCOMP until that client comes back online (which could be never). This would also mean that it could never publish another message as at QOS2 there can only be one message in flight at a time.

That diagram can not be correct. (It also has the broker storing the message before it's been delivered from the publishing client). It also doesn't handle what happens if the subscribing client subscribes at QOS0 or QOS1