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

Make Subscription isValid check more robust #126

Closed
stevenosborne-wf opened this issue Aug 9, 2017 · 3 comments
Closed

Make Subscription isValid check more robust #126

stevenosborne-wf opened this issue Aug 9, 2017 · 3 comments

Comments

@stevenosborne-wf
Copy link

The documentation for a Subsriptions's isValid method claims to check if subscription is "active". However, looking over the source code, it appears to just check that the Subscription object was initialized with a non-null ConnectionImpl. This private conn class variable doesn't even to be set to null upon unsubscribe. As a minimum, conn should be set to null on unsubscribe. Ideally, it would check more state on the connection to ensure messages can actually make it to the subscription.

@tylertreat
Copy link
Contributor

tylertreat commented Aug 9, 2017

It looks like the subscription's conn is already being set to null on unsubscribe: https://github.com/nats-io/java-nats/blob/1.0/src/main/java/io/nats/client/ConnectionImpl.java#L1527-L1528

@sasbury
Copy link
Contributor

sasbury commented Jul 3, 2018

We are working on a new version of the client that should resolve this issue, I am leaving the issue open for now, but if you are interested in this feature please try the new library in the version2 branch. Feedback is appreciated.

@sasbury
Copy link
Contributor

sasbury commented Jul 17, 2018

Fixed in version 2.

@sasbury sasbury closed this as completed Jul 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants