-
Notifications
You must be signed in to change notification settings - Fork 699
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
support custom inbox prefixes #767
Conversation
Signed-off-by: R.I.Pienaar <rip@devco.net>
This has been discussed a few times, Derek mentioned he has some other ideas but that I should open this to start a discussion. Let me know your thoughts, I think supporting this is pretty important for peoples ability to create private comms channels as it lets them make predictable inbox patterns |
So at a very high level we want to present a way for folks to make sure only they can see any given response and not have to abandon use of nc.Request() and the like correct? |
Well, that might be one possible outcome? I think there are many reasons to avoid a one-size-fits-all inbox pattern. Even if not private in many of my use cases I prefix all related traffic by some string - I want the inboxes there too. That's not about privacy as such but about just managing ACLs now of course I think we need private reply subjects that just work and don't require special ACLs and such, but thats probably more than I wish to tackle - I think we'll have inboxes like this for a long time |
Signed-off-by: R.I.Pienaar <rip@devco.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, but will let Derek decide if we go with that or other approach.
@derekcollison what are your thoughts here? |
I will try to find some time this week to think harder about it. |
@derekcollison this PR seems ok to me as is as discussed Here's the matching feature in nats.java nats-io/nats.java@03c22e4 and .Net nats-io/nats.net#322 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I supply a custom prefix of say "derek", does my inbox look like derek.NUID.NUID or does it look like derek._INBOX.NUID.NUID?
_INBOX is replaced with prefix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - Have not tested it but if it replaces _INBOX and tests pass looks good. I could use my own prefix of "_INBOX.derek" if I wanted as well for the use case we discussed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This was introduced by PR #767 when the nuidSize was used instead of replySuffixLen to just build the reply suffix. This meant that the suffix part with 22 characters long and had lots of zeros at the end. Added a test to make sure we don't break that in the future. Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
Signed-off-by: R.I.Pienaar rip@devco.net