diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/ReactorNettyWebSocketSession.java b/spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/ReactorNettyWebSocketSession.java index 4b27f6d8d9b..b769e983f5b 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/ReactorNettyWebSocketSession.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/ReactorNettyWebSocketSession.java @@ -70,9 +70,10 @@ public class ReactorNettyWebSocketSession @Override public Mono close(CloseStatus status) { return Mono.error(new UnsupportedOperationException( - "Currently in Reactor Netty applications are expected to use the " + - "Cancellation returned from subscribing to the \"receive\"-side Flux " + - "in order to close the WebSocket session.")); + "Reactor Netty does not support closing the session from anywhere. " + + "You will need to work with the Flux returned from receive() method, " + + "either subscribing to it and using the returned Disposable, " + + "or using an operator that cancels (e.g. take).")); }