-
Notifications
You must be signed in to change notification settings - Fork 39
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
handle no responders in NatsSubBase #277
Conversation
Signed-off-by: Caleb Lloyd <caleb@synadia.com>
@mtmk let me know if you prefer this approach - then we can fix/add tests here |
Does this impþementation kill the subscription? It's important in my opinion that the subscription be left intact for custom implementations of request-reply. My use case for example needs the subscription to stay intact for performance reasons (avoids the overhead of a new inbox + subscription for every request). |
Yes. But you can explicitly set NatsSubOpts.ThrowIfNoResponders=false and perform the check for a 503 code in the headers yourself. |
Note that Request-Reply uses the muxed Inbox Subscription by default, which muxes all subscriptions over a single persistent NATS Subscription. So there's no additional NATS Subscription overhead on Inbox Subscriptions (except for the first one established). |
I'm mainly concerned about auto unsubs. especially empty message check silently unsubs which could be source of hard to find bugs. also no-responders check may be OK but that only happens on reply inbox subscriptions and not all subscriptions. |
If you chose to implement this feel free to get rid of #275 |
Both I think this matches all of the previous behavior. |
Should be ready for review |
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.
a few nits
Signed-off-by: Caleb Lloyd <caleb@synadia.com>
Signed-off-by: Caleb Lloyd <caleb@synadia.com>
Signed-off-by: Caleb Lloyd <caleb@synadia.com>
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
Thank you @caleblloyd! was there any other change you wanted to make before merge? |
Nope- just merged! |
Handles No Responders in
NatsSubBase
, pre-de-serializationAlso handles
StopOnEmptyMsg
This prevents the library from ever needing to check
msg.Data
for an Empty value