-
Notifications
You must be signed in to change notification settings - Fork 14
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
Nats: guarantee order of message reception #58
Comments
One proposed solution is to create a flag |
Why would we want this to be configurable? substrate, at the api level, guarantees order, and should do whatever it needs to make sure the underlying broker does that, and to error of not. We should not be exposing this choice to the consumer. If they don't want ordering, don't use substrate. |
Because there are valid cases when using groups with multiple consumers where the sequential test will fail. |
So maybe we can get rid of None, but we can keep Ordered and Sequential (default) |
Why can't we expose no configuration, but always unconditionally check that the sequence is increasing and error if it goes down? |
That works when you have only one consumer. |
I didn't think Nats Streaming itself guaranteed message order? |
Yes, it's unfortunate, but nats-streaming "tries" to deliver in order, but there are cases where it does not. We can't really fix that in substrate, but we might possibly detect it and protect the consumer from it by erroring or something. It's not clear whether it's worth the complexity. |
Currently there is no guarantee messages are received in order when using nats streaming.
This can be easily fixed by checking the msg.Sequence.
2 cases can be implemented:
SequenceGuarantee
we receive the right sequence of events. 4,5,6,7,8...OrderGuarantee
: we receive the messages in order 4,5,8,9,30,31,34... which will work when group subscriptions are expected to be used.The text was updated successfully, but these errors were encountered: