-
Notifications
You must be signed in to change notification settings - Fork 766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Acknowledged delivery: semantics #764
Comments
The code that needs to be touched is here |
So, as far as I see it: 4, I think, doesn't have much use (what does the router do with the message? Does it forward it to the original publisher? What would the publisher then do with it?). 3, I feel, mixes up user code and the WAMP transport. WAMP is responsible for getting your messages there, but I don't think it should care about whether the subscription handler was successful. Again, I'm not sure what it would do -- would the router resend it if it failed? It will probably just make code that isn't written entirely transactionally do bad things. Also, what if the subscription handler never finishes, or finishes in a long time comparatively for QoS? 2 has the same problem about long running things. 1, I think, is the way to go. It follows the semantics of other protocols in that QoS is entirely the transport responsibility and not the application responsibility. MQTT, for example, uses it for transferring 'responsibility' from point to point, it does not take into account what the application on the other end does with it. I think this is the most obvious, as it doesn't bring into the question what a failure means to WAMP -- an Exception could be totally reasonable, and we don't want the QoS resending a packet that is valid on the transport, received on the other end, but is invalid according to the semantics of the application. It is, coincidentally, also the simplest -- you send a EVENT_RECEIVED immediately, so there is low latency (lowering the risk of duplicated packets if the connection goes down in the middle), and it removes the question of what we do on failure (we simply log it as we do already) and what happens if the event handler never ends (doesn't matter, as the ACK has been sent already). It also makes it similar to how QoS2 will have to work -- because there are 2 RTs instead of 1, we then don't have to decide when we send each part of the QoS -- we simply do it as it is received. |
I agree with @hawkowl that all WAMP should care about is getting the event there. What happens inside the user code is not our concern, and we shouldn't go there. Acknowledgement that components have successfully executed code based on a received subscription are an application-level concern. This will often involve more than just the subscription handler executing without an error, and components other than the publisher may be the ones concerned with the outcome. |
Ok, agreed:
I also think |
Do we have QoS mode option for SUBSCRIBE already? I mean in AB, like in |
The relevant MQTT spec section about QoS is here |
In particular, this:
and the footnote:
"complete delivery of the Application Message": I read that as that we do not have to wait for the user code subscription handler to finish - we may do so (it does not say MUST NOT), but why should we? ;) So think what we agreed to in above for QoS 1 is in line with MQTT QoS 1 semantics. Interestingly, the MQTT spec has this footnote for QoS 2:
This means, MQTT can not be used for full blown ACID compliant transactional messaging. Which is good, because that would require to make a 2-phase-commit, distributed transaction manager (integrated down to the protocol) available/accesible at the app layer. Which not only sounds complex, but is complex;) |
Btw, in case you wonder about the answer to this question: "MQTT - QoS - what does TCP not provide which MQTT does?" I think this is a question that naturally arises, and the question is formulated nicely. The answer is in the spec:
and here
That means, we don't need any timers or such (because TCP takes care). It also means: without session resumption, both QoS 1 and 2 are void. |
I am really wondering what they are talking about here. TCP is reliable regardless of underlying OSI 1/2 tech. So there is no "data loss" to overcome .. on what "older TCP networks". I don't get that part. |
What semantics should "acknowledged event delivery" have?
An EVENT is to be answered by EVENT_RECEIVED
The text was updated successfully, but these errors were encountered: