Christiaan Willemsen
Christiaan Willemsen

Reputation: 141

MQTT wildcard subscriptions, backpressure and QOS

This is more of a generic question, however it might be handled differently in different clients or protocol versions or possibly even server versions.

So I'm talking QOS level 2 subscription here. In which case packets are handled in order. And since there is a acknowledgement protocol, it means that the next message cannot be handled until the first one is acked? Or it ordering only maintained for reception, and not for acknowledgement?

In case backpressure is exerted via the acknowledgements, how does that relate to wildcard topics? There "order" is actually only a real concept for the individual containing topics, not the whole wildcard. Does that then mean that the backpressure is also handled on a per topic basis, or is it maintained on the total wildcard subscription basis?

Edit:

so I did some tests with HiveMQ and Misquitto. Both of these exibit the same behaviour: As soon as you do not call a callback on a QOS2 packet, the whole thing stops responding to anything. it does not even seem to have anything to to with wildcards either.

So as a test I have three topics:test/1, test/2, test2/1

test/2 messages never get acknowledged.

I've tried to wireshark the issue to see what's going on. What happens after I send a message to test/2, consequent messages never get send to the wildcard subscriber, regardless to what topic. That would denote the fact that indeed wildcard subscriptions do not really care about the underlying topics semantics. It's seem to be even worse: If I split the wildcard subscriptions into two seperate ones, so on test/1 and test/2, it's the exact same thing. Any QOS > 0 packet that is not released will block the whole connection! So this does not seem to indicate a direct issue with the client, but is already a server related thing. So again my original question arises: is this per spec, or is this just an implementation curiocity?

Upvotes: 2

Views: 604

Answers (1)

Mike Organek
Mike Organek

Reputation: 12484

QOS happens within the context of an individual message published to a single topic.

Wildcard subscriptions result in callbacks in the client whenever messages are published on any of the wildcard topics, but the QOS mechanism is concerned only with guaranteeing the QOS for a single message published on a single topic.

The fact that the receiving client is subscribed to multiple topics is not relevant to handling QOS.

Upvotes: 1

Related Questions