diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/handler/ConcurrentWebSocketSessionDecorator.java b/spring-websocket/src/main/java/org/springframework/web/socket/handler/ConcurrentWebSocketSessionDecorator.java index c5fe7f852691..bcc478ca47c5 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/handler/ConcurrentWebSocketSessionDecorator.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/handler/ConcurrentWebSocketSessionDecorator.java @@ -275,6 +275,13 @@ public void close(CloseStatus status) throws IOException { } } + /** + * Return the configured overflow strategy. + * @since 6.3 + */ + public OverflowStrategy getOverflowStrategy() { + return this.overflowStrategy; + } @Override public String toString() { diff --git a/spring-websocket/src/test/java/org/springframework/web/socket/handler/ConcurrentWebSocketSessionDecoratorTests.java b/spring-websocket/src/test/java/org/springframework/web/socket/handler/ConcurrentWebSocketSessionDecoratorTests.java index 8f8b595e81f6..da08400d94ac 100644 --- a/spring-websocket/src/test/java/org/springframework/web/socket/handler/ConcurrentWebSocketSessionDecoratorTests.java +++ b/spring-websocket/src/test/java/org/springframework/web/socket/handler/ConcurrentWebSocketSessionDecoratorTests.java @@ -215,4 +215,14 @@ private void sendBlockingMessage(ConcurrentWebSocketSessionDecorator session) th assertThat(latch.await(5, TimeUnit.SECONDS)).isTrue(); } + @Test + void configuredProperties() { + TestWebSocketSession session = new TestWebSocketSession(); + ConcurrentWebSocketSessionDecorator sessionDecorator = new ConcurrentWebSocketSessionDecorator(session, 42, 43, OverflowStrategy.DROP); + + assertThat(sessionDecorator.getSendTimeLimit()).isEqualTo(42); + assertThat(sessionDecorator.getBufferSizeLimit()).isEqualTo(43); + assertThat(sessionDecorator.getOverflowStrategy()).isEqualTo(OverflowStrategy.DROP); + } + }