Stream: subscriptions
Topic: Accuracy/atomicity of eventsSinceSubscriptionStart
Jenni Syed (Sep 10 2020 at 20:38):
This was discussed a bit on the call this morning... but want some additional feedback. What is the expectation around accuracy of http://build.fhir.org/subscriptionstatus-definitions.html#SubscriptionStatus.eventsSinceSubscriptionStart?
Josh Mandel (Sep 10 2020 at 20:39):
This is the mechanism for clients to detect missing or out-of-order messages. So the expectation is that they are accurate, otherwise the client can't detect missed messages. Unless there's some way to specify a certain amount of slip/slop in the protocol...
Yazan Al-Alul (Sep 10 2020 at 20:51):
To give more context, my concern is that it's possible for the notification component on the server to succeed in sending the event to the subscriber, but fail before it has stored the updated value of the counter.
Yazan Al-Alul (Sep 10 2020 at 20:54):
And similarly if the server is keeping track of which subscriptions it has notified of an event, if it sends the notification but isn't able to persist that it did send it successfully, the server would potentially end up sending a duplicate notification to that subscriber
Josh Mandel (Sep 10 2020 at 20:58):
In general we don't require guaranteed delivery and we don't prevent duplicate delivery. But we do expect clients to be able to detect (at least as often as their heartbeat interval) whether messages have been missed. So in the examples above, you'd want to allocate a "new event count" before you send out a message, since the updated count appears in the message. It's about events for which you have made notification attempts.
As the spec says, SubscriptionStatus.eventsSinceSubscriptionStart
is the:
number of unique events that have triggered notification attempts on this Subscription inclusive of the current notification being sent
Yazan Al-Alul (Sep 11 2020 at 16:48):
Thanks Josh, that makes sense. I think it would be good to explicitly call out that duplicate notifications are possible
Josh Mandel (Sep 11 2020 at 16:57):
Agreed!
Last updated: Apr 12 2022 at 19:14 UTC