-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Is your feature request related to a problem? Please describe.
A common problem that occurs with DistributedPubSub is when both the publisher and the subscriber start at essentially the same time, but on different nodes, and it takes a moment for that subscription to replicate. You end up with an immediate DeadLetter per #7626 and the publisher is never notified that this happened unless the end-user implements their own explicit ACK-reply system from all subscribers.
This makes DistributedPubSub kind of unwieldy to use in cases that require a higher degree of consistency.
Describe the solution you'd like
I think it would be worth doing two things:
- Create a new
PublishWithAckmessage that sends a reply back to the publisher, letting them know that the message was sent toNnodes with subscribers. That way the publisher can get feedback on whether or not their message was actually delivered to someone without having to write infrastructure to do this themselves in the subscriber actors. - Create a new
WaitForSubscribersvalue - we shouldn't let the user do stuff like specifying the number of subscribers because users will 100% interpret that to mean "the number of subscribers" and not the "number of nodes with subscribers," the latter being what we actually can measure. This should also have a timeout property to prevent memory build up and theDistributedPubSubshould have a max-buffer-size setting for the number of "waiting" messages it will allow per-topic.
Describe alternatives you've considered
The alternatives are forcing the user to do all of this themselves via the queries we added to support #3663 - which is very high-boilerplate, janky, and generally not good.