Skip to content

WebSocketGraphQlClient unable to reconnect after the first reconnect failure #826

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jma-9code opened this issue Sep 22, 2023 · 1 comment
Assignees
Labels
type: bug A general bug
Milestone

Comments

@jma-9code
Copy link

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?

@jma-9code jma-9code changed the title Unable to retry WebSocketGraphQlClient if he can't connect to the server one time WebSocketGraphQlClient Unable to Retry Connection after Initial Connection Failure Sep 22, 2023
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 22, 2023
@rstoyanchev rstoyanchev self-assigned this Oct 27, 2023
@rstoyanchev rstoyanchev added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 27, 2023
@rstoyanchev rstoyanchev added this to the 1.2.4 milestone Oct 27, 2023
@rstoyanchev
Copy link
Contributor

I confirm there is an issue. For the version, I think you mean Boot 3.1.4 as 3.2 is not GA yet.

@rstoyanchev rstoyanchev changed the title WebSocketGraphQlClient Unable to Retry Connection after Initial Connection Failure WebSocketGraphQlClient unable to connect after the first reconnect failure Oct 27, 2023
@rstoyanchev rstoyanchev changed the title WebSocketGraphQlClient unable to connect after the first reconnect failure WebSocketGraphQlClient unable to reconnect after the first reconnect failure Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants