socket
This commit is contained in:
@@ -3,9 +3,11 @@ package com.sqx;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.web.socket.config.annotation.EnableWebSocket;
|
||||
|
||||
|
||||
@EnableScheduling
|
||||
@EnableWebSocket
|
||||
@SpringBootApplication
|
||||
public class SqxApplication {
|
||||
|
||||
@@ -21,4 +23,4 @@ public class SqxApplication {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
||||
* websocket的配置
|
||||
*/
|
||||
@Configuration
|
||||
public class WebSocketStompConfig{
|
||||
public class WebSocketStompConfig {
|
||||
//这个bean会自动注册使用了@ServerEndpoint注解声明的Websocket endpoint
|
||||
@Bean
|
||||
public ServerEndpointExporter serverEndpointExporter()
|
||||
|
||||
Reference in New Issue
Block a user