Code review comment: I have created the retryClient as per the offline discussion.

Code under review:
public static void initEndpoint(ObjectValue webSocketClient) {
        @SuppressWarnings(WebSocketConstants.UNCHECKED)
        MapValue<String, Object> clientEndpointConfig = (MapValue<String, Object>) webSocketClient.getMapValue(
                HttpConstants.CLIENT_ENDPOINT_CONFIG);
        Strand strand = Scheduler.getStrand();
        String remoteUrl = webSocketClient.getStringValue(WebSocketConstants.CLIENT_URL_CONFIG);
        WebSocketService wsService = WebSocketUtil.validateAndCreateWebSocketService(strand, clientEndpointConfig);
        HttpWsConnectorFactory connectorFactory = HttpUtil.createHttpWsConnectionFactory();
        WebSocketClientConnectorConfig clientConnectorConfig = new WebSocketClientConnectorConfig(remoteUrl);
        String scheme = URI.create(remoteUrl).getScheme();
        WebSocketUtil.populateClientConnectorConfig(clientEndpointConfig, clientConnectorConfig, scheme);
        
        WebSocketClientConnector clientConnector = connectorFactory.createWsClientConnector(clientConnectorConfig);
        webSocketClient.addNativeData(WebSocketConstants.CONNECTOR_FACTORY, connectorFactory);
        
        
        webSocketClient.addNativeData(WebSocketConstants.CLIENT_CONNECTOR, clientConnector);
        if (webSocketClient.getType().getName().equalsIgnoreCase(WebSocketConstants.WEBSOCKET_CLIENT)) {
            if (WebSocketUtil.hasRetryContext(webSocketClient)) {
                @SuppressWarnings(WebSocketConstants.UNCHECKED)
                MapValue<String, Object> retryConfig = (MapValue<String, Object>) clientEndpointConfig.getMapValue(
                        WebSocketConstants.RETRY_CONTEXT);
                RetryContext retryConnectorConfig = new RetryContext();
                populateRetryConnectorConfig(retryConfig, retryConnectorConfig);
                webSocketClient.addNativeData(WebSocketConstants.RETRY_CONTEXT, retryConnectorConfig);
                webSocketClient.addNativeData(WebSocketConstants.CLIENT_LISTENER, new RetryConnectorListener(
                        new ClientConnectorListener()));
            } else {
                webSocketClient.addNativeData(WebSocketConstants.CLIENT_LISTENER, new ClientConnectorListener());
            }
        }
        CountDownLatch countDownLatch = new CountDownLatch(1);
        webSocketClient.addNativeData(WebSocketConstants.COUNT_DOWN_LATCH, countDownLatch);
        WebSocketUtil.establishWebSocketConnection(clientConnector, webSocketClient, wsService);
        
        WebSocketUtil.waitForHandshake(countDownLatch);
    }

Line commented on: new ClientConnectorListener()));

Revised code:
public static void initEndpoint(ObjectValue webSocketClient) {
        @SuppressWarnings(WebSocketConstants.UNCHECKED)
        MapValue<String, Object> clientEndpointConfig = (MapValue<String, Object>) webSocketClient.getMapValue(
                WebSocketConstants.CLIENT_ENDPOINT_CONFIG);
        Strand strand = Scheduler.getStrand();
        String remoteUrl = webSocketClient.getStringValue(WebSocketConstants.CLIENT_URL_CONFIG);
        WebSocketService wsService = WebSocketUtil.validateAndCreateWebSocketService(strand, clientEndpointConfig);
        HttpWsConnectorFactory connectorFactory = HttpUtil.createHttpWsConnectionFactory();
        WebSocketClientConnectorConfig clientConnectorConfig = new WebSocketClientConnectorConfig(remoteUrl);
        String scheme = URI.create(remoteUrl).getScheme();
        WebSocketUtil.populateClientConnectorConfig(clientEndpointConfig, clientConnectorConfig, scheme);
        
        WebSocketClientConnector clientConnector = connectorFactory.createWsClientConnector(clientConnectorConfig);
        webSocketClient.addNativeData(WebSocketConstants.CONNECTOR_FACTORY, connectorFactory);
        
        
        webSocketClient.addNativeData(WebSocketConstants.CLIENT_CONNECTOR, clientConnector);
        if (webSocketClient.getNativeData(WebSocketConstants.CLIENT_LISTENER) == null) {
            webSocketClient.addNativeData(WebSocketConstants.CLIENT_LISTENER, new ClientConnectorListener());
        }
        CountDownLatch countDownLatch = new CountDownLatch(1);
        webSocketClient.addNativeData(WebSocketConstants.COUNT_DOWN_LATCH, countDownLatch);
        WebSocketUtil.establishWebSocketConnection(clientConnector, webSocketClient, wsService);
        
        WebSocketUtil.waitForHandshake(countDownLatch);
    }