Home > Back-end >  Springboot2 AbstractWebSocketMessageBrokerConfigurer obsolete
Springboot2 AbstractWebSocketMessageBrokerConfigurer obsolete

Time:12-10

Practice springboot program, the compiler hint AbstractWebSocketMessageBrokerConfigurer obsolete, project, of course, also can not run, who know its replacement class is what?

CodePudding user response:

Resolved
Query the official documentation to know
Will extends AbstractWebSocketMessageBrokerConfigurer instead implements WebSocketMessageBrokerConfigurer

CodePudding user response:

To force ah, excuse me I want to make a token authentication for the first time to shake hands again, and the configuration class (WebSocketConfig) how to write, online to find a pile of both try sromjs feeling of trival, there is no direct handshake before cutting

CodePudding user response:

reference ah is your reply on the second floor:
to force ah, excuse me, I want to make a token authentication for the first time to shake hands again, and the configuration class (WebSocketConfig) how to write, online to find a pile of both try sromjs feeling of trival, there is no direct handshake before cutting it


https://docs.spring.io/spring/docs/5.1.3.RELEASE/spring-framework-reference/web.html#websocket-server
Add an interceptor
@ Configuration
@ EnableWebSocket
Public class WebSocketConfig implements WebSocketConfigurer {

@ Override
Public void registerWebSocketHandlers (WebSocketHandlerRegistry registry) {
Registry. AddHandler (new MyHandler (), "/MyHandler")
AddInterceptors (new HttpSessionHandshakeInterceptor ());
}

}

CodePudding user response:

Will extends AbstractWebSocketMessageBrokerConfigurer instead implements WebSocketMessageBrokerConfigurer validation is feasible

CodePudding user response:

CodePudding user response:

Implements WebSocketMessageBrokerConfigurer
  • Related