@Override
    public void close() {
        try {
            this.connection.closeDispatcher(this.messageDispatcher);
            this.connection.close();
        } catch (InterruptedException e) {
            this.plugin.getLogger().warn("An error occurred during closing messenger.", e);
        }
    }
An implementation of Messenger for Nats messaging client.
common/src/main/java/me/lucko/luckperms/common/messaging/nats/NatsMessenger.java