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

Ideas: drain with close, connection bean without real connection #15

Open
moleksyuk opened this issue May 4, 2020 · 0 comments
Open

Comments

@moleksyuk
Copy link

Hi guys,

After usage of nats java client with spring-boot-starter I found such inconvenient moments:

  1. Connection implements Autoclosable and it's called during Spring Applicaiton Shutdown but I'm expecting that drain() will be called as well. In this case I need to implement some Spring DispoasableBean and call drain there. 😞
    Proposal: include drain() in close().

  2. I have an application that uses Nats. That part of the application is not critical and it's ok if for some period that Nats Cluster will be down. So if Nats Cluster is not up and running I can't:

  • start application
  • scale-up already running application
    because Nats.connect() will throw an exception and my spring context will not be constructed and application startup fail.
    Proposal: Maybe return some lazy connection that will try to connect during call some of its interface. But here could be a problem with subscribers that should be created for example in @PostConstruct method.
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

1 participant