Skip to content

WebSocketGraphQlClient unable to reconnect after the first reconnect failure #826

Closed
@jma-9code

Description

@jma-9code

Context:

Using Spring Boot 3.2.4 with Spring WebFlux/GraphQL.

Server A exposes a graphqlSubscription, and Server B consumes the subscription. They both use the same components (reactor/netty).

Steps to Reproduce:

Client Sample:

// Initialize the webSocketGraphQlClient
ReactorNettyWebSocketClient reactorNettyWebSocketClient = new ReactorNettyWebSocketClient(HttpClient.create(), build);
WebSocketGraphQlClient.builder(webSocketGraphQlVideoServerUrl, reactorNettyWebSocketClient).build();

// Call sample
webSocketGraphQlClient
        .document(query)
        .retrieveSubscription(path)
        .toEntity(XXXX.class)
        .retryWhen(Retry.fixedDelay(5, Duration.ofMinutes(1))).blockLast()

Not Working Cases:

Case 1:

  1. Run the client.
  2. Wait for the first RETRY.
    => GraphQlTransportException => connection refused.
  3. Run the server.
  4. KO -> the next retry will fail with the same reason.

Case 2:

  1. Run the server.
  2. Run the client.
  3. Shutdown the server.
  4. FIRST RETRY
    => WebSocketDisconnectedException -> connection is closed or lost.
  5. Wait for the SECOND RETRY.
    => GraphQlTransportException => connection refused.
  6. Run the server.
  7. KO -> the next retry will fail with the same reason.

Working Case:

  1. Run the server.
  2. Run the client.
  3. Shutdown the server.
  4. Wait for the FIRST RETRY.
    => WebSocketDisconnectedException -> connection is closed or lost.
  5. Run the server.
  6. OK, the retry is working.

Is there a way to resume a WebSocket connection when the client failed to connect to the remote server?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions