code: public void connect() throws IOException, DeploymentException {
          WebSocketContainer container = ContainerProvider.getWebSocketContainer();
          container.connectToServer(this, wssUri);
          log.debug("client connected to the server: {}", wssUri);
      }
docs: Connects to the wss endpoint and starts a new WebSocket session.
  If you'd like to reconnect to the endpoint with this instance, call #reconnect() instead.
  Calling this method won't work as you expect.