-
Notifications
You must be signed in to change notification settings - Fork 698
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
JetStreamManager.AddConsumer ambiguous behaviour with existing consumer #1542
Comments
This behaviour is on purpose, as in distributed systems like NATS, retrying the same operation in case of failure might be necessary in case of transient unavailability and by making The distinction between
If config is exactly the same, it's a noop for the server/meta leader. |
@Jarema thank you for the quick update. However, as I said, than this should be explicitly documented, correct? I cannot find any reference about this behavior, yet your verbose explanation is very precise and helpful, so perhaps it could be incorporated in the docs right away? :) |
This is fantastic info! Thank you so much for your quick support; actually, this is desired behavior for my use case, I just wasn't sure if it is designed exactly that way! |
The documentation for Thanks for bringing this to our attention! |
Observed behavior
AddConsumer
returns no error if it "creates" already existing consumer with exactly the same configuration options.Expected behavior
Return
JSErrCodeConsumerAlreadyExists
for the same configuration of existing consumer on the server.Server and client version
nats-server
Version: 2.10.9
Git Commit: a5298e2
Driver
github.com/nats-io/nats.go v1.32.0
Host environment
Host
go version go1.20.13 windows/amd64
Server
x64/aarch64 Linux NATS cluster with versions 2.10.9
Steps to reproduce
Invoke
AddConsumer
with anats.ConsumerConfig{}
configuration and repeat it again with the same configuration.I would either expect an error or more verbose documentation about this behavior.
The text was updated successfully, but these errors were encountered: