Skip to content
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

[suggestion] [nats-streaming] Expose durable connection parameter #60

Closed
thinktainer opened this issue Apr 5, 2019 · 7 comments
Closed
Assignees

Comments

@thinktainer
Copy link
Contributor

If one passes an empty queue-group parameter then the client creates that subscription as a non durable. This is surprising behavior. Rather than trying to hide the underlying subscription model, it should be possible for a user to specify exactly what they want.
I suggest exposing the durable parameter as a configuration option. The matrix of these options would then look like this:

durable not set, and queue group set

queue subscription with durable name "substrate" and configured queue name

durable set and queue group not set

regular (non queuegroup) subscription with configured durable name

neither durable nor queue group set

regular (non durable, non queue group) subscription, with warning that this is a non permanent subscription

@thinktainer
Copy link
Contributor Author

related to #56 and #55

@mjgarton
Copy link
Contributor

What would you currently expect to happen if passing an empty queue group?

Do you think we can make these changes without breaking compatibility with current users? If so, PR welcome.

@basia-horwath
Copy link

I support this suggestion 100%. I would currently like to use the 2nd scenario, but I cannot.

I would just change the 1st scenario to not set any default value for durable, as the behaviour might then be confusing.

If somebody wants to use durable, they will have to explicitly set it.

@basia-horwath
Copy link

Screen Shot 2019-04-29 at 16 03 46

@thinktainer
Copy link
Contributor Author

If there's no objections to this going in I'll prepare a patch shortly @mjgarton @SpeedyCoder

@SpeedyCoder
Copy link
Contributor

I would maybe consider using queue group as the durable name in case the durable name is not set to match the behaviour of the current implementation. We can alternatively return an error in that case in order to force users to specify the durable name... Overall I would prefer things to error rather than using a default name like substrate...

@thinktainer
Copy link
Contributor Author

My point of view is that the best thing to do is to mirror the underlying implementation. So if a durable name is not specified you get a non durable queue subscription. From a users point of view I think this is the least surprising.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants