Skip to content

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

@moleksyuk

Description

@moleksyuk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions