@AutoConfiguration(after=WebSocketSessionHandshakeInterceptor.class) @EnableScheduling @EnableWebSocketMessageBroker public class WebSocketMessageBrokerConfiguration extends org.springframework.session.web.socket.config.annotation.AbstractSessionWebSocketMessageBrokerConfigurer<org.springframework.session.Session>
Description: WebSocketMessageBrokerConfigurer
| 构造器和说明 |
|---|
WebSocketMessageBrokerConfiguration(WebSocketProperties webSocketProperties,
WebSocketChannelInterceptor webSocketChannelInterceptor,
WebSocketSessionHandshakeInterceptor webSocketSessionHandshakeInterceptor) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
configureClientInboundChannel(org.springframework.messaging.simp.config.ChannelRegistration registration)
采用自定义拦截器,获取connect时候传递的参数
设置输入消息通道的线程数,默认线程为1,可以自己自定义线程数,最大线程数,线程存活时间
|
void |
configureClientOutboundChannel(org.springframework.messaging.simp.config.ChannelRegistration registration)
设置输出消息通道的线程数,默认线程为1,可以自己自定义线程数,最大线程数,线程存活时间
|
void |
configureMessageBroker(org.springframework.messaging.simp.config.MessageBrokerRegistry registry)
配置消息代理
|
protected void |
configureStompEndpoints(org.springframework.web.socket.config.annotation.StompEndpointRegistry registry)
添加 Stomp Endpoint,创建配置客户端尝试连接地址,并对外暴露该接口,这样就可以通过websocket连接上服务
|
void |
configureWebSocketTransport(org.springframework.web.socket.config.annotation.WebSocketTransportRegistration registration)
配置发送与接收的消息参数,可以指定消息字节大小,缓存大小,发送超时时间
|
void |
postConstruct() |
registerStompEndpoints, sessionRepositoryInterceptor, webSocketRegistryListener, wsConnectHandlerDecoratorFactorypublic WebSocketMessageBrokerConfiguration(WebSocketProperties webSocketProperties, WebSocketChannelInterceptor webSocketChannelInterceptor, WebSocketSessionHandshakeInterceptor webSocketSessionHandshakeInterceptor)
@PostConstruct public void postConstruct()
protected void configureStompEndpoints(org.springframework.web.socket.config.annotation.StompEndpointRegistry registry)
configureStompEndpoints 在类中 org.springframework.session.web.socket.config.annotation.AbstractSessionWebSocketMessageBrokerConfigurer<org.springframework.session.Session>registry - StompEndpointRegistrypublic void configureMessageBroker(org.springframework.messaging.simp.config.MessageBrokerRegistry registry)
registry - MessageBrokerRegistrypublic void configureWebSocketTransport(org.springframework.web.socket.config.annotation.WebSocketTransportRegistration registration)
configureWebSocketTransport 在接口中 org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurerconfigureWebSocketTransport 在类中 org.springframework.session.web.socket.config.annotation.AbstractSessionWebSocketMessageBrokerConfigurer<org.springframework.session.Session>registration - WebSocketTransportRegistrationpublic void configureClientInboundChannel(org.springframework.messaging.simp.config.ChannelRegistration registration)
configureClientInboundChannel 在接口中 org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurerconfigureClientInboundChannel 在类中 org.springframework.session.web.socket.config.annotation.AbstractSessionWebSocketMessageBrokerConfigurer<org.springframework.session.Session>registration - ChannelRegistrationpublic void configureClientOutboundChannel(org.springframework.messaging.simp.config.ChannelRegistration registration)
registration - ChannelRegistrationCopyright © 2023 Dromara. All rights reserved.