diff --git a/wicket-spring-boot-starter/src/main/java/com/giffing/wicket/spring/boot/starter/web/servlet/websocket/WebSocketMessageSenderDefault.java b/wicket-spring-boot-starter/src/main/java/com/giffing/wicket/spring/boot/starter/web/servlet/websocket/WebSocketMessageSenderDefault.java index 5a9da1d2..ebcae4f0 100644 --- a/wicket-spring-boot-starter/src/main/java/com/giffing/wicket/spring/boot/starter/web/servlet/websocket/WebSocketMessageSenderDefault.java +++ b/wicket-spring-boot-starter/src/main/java/com/giffing/wicket/spring/boot/starter/web/servlet/websocket/WebSocketMessageSenderDefault.java @@ -34,11 +34,12 @@ public void sendToAll(IWebSocketPushMessage event) { } } - public void sendTo(Object identifier, IWebSocketPushMessage event) { + @Override + public void sendTo(Object identifier, IWebSocketPushMessage event) { if(identifier == null) { return; } - Application application = Application.get(); + WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(application); IWebSocketConnectionRegistry connectionRegistry = webSocketSettings.getConnectionRegistry(); wicketSessionResolver.resolve(identifier).forEach(sessionId -> { @@ -49,5 +50,4 @@ public void sendTo(Object identifier, IWebSocketPushMessage event) { } }); } - }