From WebSocket Endpoint I try to call Singleton Service. But I an unable to use Request or Session scope from WebSocket.
(@Scope( value = "request", proxyMode = ScopedProxyMode.TARGET_CLASS))
I get Scope 'request' is not active for the current thread; For 'request' or 'session' scope on any 'ScopedProxyMode'.
Thanks for the help!
For web sockets there are no request/response so the request scope is invalid. They introduced new scope called websocket in Spring 4.1. @Scope(name = "websocket", proxyMode = ScopedProxyMode.TARGET_CLASS). Example reference link
http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#websocket-stomp-websocket-scope
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With