 server(&#34;nats://demo.nats.io:4222&#34;).
                            connectionListener((conn, type) -&gt; {
                                if (type == Events.RECONNECTED) {
                                    // handle reconnected
                                } else if (type == Events.DISCONNECTED) {
                                    // handle disconnected, wait for reconnect
                                }
                            }).
                            build();
Connection nc = Nat