DistributedPubSub
: add a wait-for-subscribers
value to Publish
commands to delay publishing / discarding until subscribers are available
#7627
Labels
akka-cluster-tools
discussion
DX
Developer experience issues - papercuts, footguns, and other non-bug problems.
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 immediateDeadLetter
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:
PublishWithAck
message that sends a reply back to the publisher, letting them know that the message was sent toN
nodes 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.WaitForSubscribers
value - 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 theDistributedPubSub
should 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.
The text was updated successfully, but these errors were encountered: