接口 WebSocketMessageBrokerConfigurer
public interface WebSocketMessageBrokerConfigurer
Defines methods for configuring message handling with simple messaging protocols (e.g. STOMP) from WebSocket clients.Typically used to customize the configuration provided via
@EnableWebSocketMessageBroker
.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 void
addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers)
Add resolvers to support custom controller method argument types.void
addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers)
Add handlers to support custom controller method return value types.void
configureClientInboundChannel(ChannelRegistration registration)
Configure theMessageChannel
used for incoming messages from WebSocket clients.void
configureClientOutboundChannel(ChannelRegistration registration)
Configure theMessageChannel
used for outbound messages to WebSocket clients.void
configureMessageBroker(MessageBrokerRegistry registry)
Configure message broker options.boolean
configureMessageConverters(List<MessageConverter> messageConverters)
Configure the message converters to use when extracting the payload of messages in annotated methods and when sending messages (e.g. through the "broker" SimpMessagingTemplate).void
configureWebSocketTransport(WebSocketTransportRegistration registry)
Configure options related to the processing of messages received from and sent to WebSocket clients.void
registerStompEndpoints(StompEndpointRegistry registry)
Register STOMP endpoints mapping each to a specific URL and (optionally) enabling and configuring SockJS fallback options.
方法详细资料
registerStompEndpoints
void registerStompEndpoints(StompEndpointRegistry registry)
Register STOMP endpoints mapping each to a specific URL and (optionally) enabling and configuring SockJS fallback options.
configureWebSocketTransport
void configureWebSocketTransport(WebSocketTransportRegistration registry)
Configure options related to the processing of messages received from and sent to WebSocket clients.
configureClientInboundChannel
void configureClientInboundChannel(ChannelRegistration registration)
Configure theMessageChannel
used for incoming messages from WebSocket clients. By default the channel is backed by a thread pool of size 1. It is recommended to customize thread pool settings for production use.
configureClientOutboundChannel
void configureClientOutboundChannel(ChannelRegistration registration)
Configure theMessageChannel
used for outbound messages to WebSocket clients. By default the channel is backed by a thread pool of size 1. It is recommended to customize thread pool settings for production use.
addArgumentResolvers
void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers)
Add resolvers to support custom controller method argument types.This does not override the built-in support for resolving handler method arguments. To customize the built-in support for argument resolution, configure
SimpAnnotationMethodMessageHandler
directly.- 参数:
argumentResolvers
- the resolvers to register (initially an empty list)- 从以下版本开始:
- 4.1.1
addReturnValueHandlers
void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers)
Add handlers to support custom controller method return value types.Using this option does not override the built-in support for handling return values. To customize the built-in support for handling return values, configure
SimpAnnotationMethodMessageHandler
directly.- 参数:
returnValueHandlers
- the handlers to register (initially an empty list)- 从以下版本开始:
- 4.1.1
configureMessageConverters
boolean configureMessageConverters(List<MessageConverter> messageConverters)
Configure the message converters to use when extracting the payload of messages in annotated methods and when sending messages (e.g. through the "broker" SimpMessagingTemplate).The provided list, initially empty, can be used to add message converters while the boolean return value is used to determine if default message should be added as well.
- 参数:
messageConverters
- the converters to configure (initially an empty list)- 返回:
- whether to also add default converter or not
configureMessageBroker
void configureMessageBroker(MessageBrokerRegistry registry)
Configure message broker options.