Handle PONG messages in WebSocket handlers

See gh-534
This commit is contained in:
rstoyanchev
2024-04-11 16:59:42 +01:00
parent 74688ea4ff
commit 10ea73d150
2 changed files with 5 additions and 0 deletions

View File

@@ -183,6 +183,9 @@ public class GraphQlWebSocketHandler implements WebSocketHandler {
case PING -> {
return Flux.just(this.codecDelegate.encode(session, GraphQlWebSocketMessage.pong(null)));
}
case PONG -> {
return Flux.empty();
}
case COMPLETE -> {
if (id != null) {
Subscription subscription = subscriptions.remove(id);

View File

@@ -248,6 +248,8 @@ public class GraphQlWebSocketHandler extends TextWebSocketHandler implements Sub
ExceptionWebSocketHandlerDecorator.tryCloseWithError(session, ex, logger);
}
});
case PONG -> {
}
case COMPLETE -> {
if (id != null) {
Subscription subscription = state.getSubscriptions().remove(id);