github nats-io/nats.java 2.8.0
2.8.0 - Added support for lame duck mode notification

latest releases: 2.16.11, 2.16.10, 2.16.9...
4 years ago
  • Added lame-duck mode support 334

When a server goes into lame-duck mode. The client will send out a connection event.

Example code registering for lame-duck mode.

            Options options = new Options.Builder().server(ts.getURI()).connectionListener(new ConnectionListener() {
                @Override
                public void connectionEvent(Connection conn, Events type) {
                    if (type.equals(Events.LAME_DUCK)) connectLDM.complete(type);
                }
            }).build();

            Connection nc = Nats.connect(options);

Lame-duck mode is for servers in a cluster to tell clients that they will no longer be serving requests.
Clients can get notified of this and gracefully perform some actions.

Don't miss a new nats.java release

NewReleases is sending notifications on new releases.