public abstract class AbstractMessageBrokerConfiguration extends Object implements org.springframework.context.ApplicationContextAware
clientInboundChannel()
and clientOutboundChannel()
deliver messages
to and from remote clients to several message handlers such as
simpAnnotationMethodMessageHandler()
simpleBrokerMessageHandler()
stompBrokerRelayMessageHandler()
userDestinationMessageHandler()
brokerChannel()
delivers messages from within the application to the
the respective message handlers. brokerMessagingTemplate()
can be injected
into any application component to send messages.
Sub-classes are responsible for the part of the configuration that feed messages to and from the client inbound/outbound channels (e.g. STOMP over WebSocket).
Modifier | Constructor and Description |
---|---|
protected |
AbstractMessageBrokerConfiguration()
Protected constructor.
|
Modifier and Type | Method and Description |
---|---|
AbstractSubscribableChannel |
brokerChannel() |
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor |
brokerChannelExecutor() |
CompositeMessageConverter |
brokerMessageConverter() |
SimpMessagingTemplate |
brokerMessagingTemplate() |
AbstractSubscribableChannel |
clientInboundChannel() |
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor |
clientInboundChannelExecutor() |
AbstractSubscribableChannel |
clientOutboundChannel() |
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor |
clientOutboundChannelExecutor() |
protected void |
configureClientInboundChannel(ChannelRegistration registration)
A hook for sub-classes to customize the message channel for inbound messages
from WebSocket clients.
|
protected void |
configureClientOutboundChannel(ChannelRegistration registration)
A hook for sub-classes to customize the message channel for messages from
the application or message broker to WebSocket clients.
|
protected void |
configureMessageBroker(MessageBrokerRegistry registry)
A hook for sub-classes to customize message broker configuration through the
provided
MessageBrokerRegistry instance. |
protected boolean |
configureMessageConverters(List<MessageConverter> messageConverters)
Override this method to add custom message converters.
|
org.springframework.context.ApplicationContext |
getApplicationContext() |
protected MessageBrokerRegistry |
getBrokerRegistry()
An accessor for the
MessageBrokerRegistry that ensures its one-time creation
and initialization through configureMessageBroker(MessageBrokerRegistry) . |
protected ChannelRegistration |
getClientInboundChannelRegistration() |
protected ChannelRegistration |
getClientOutboundChannelRegistration() |
org.springframework.validation.Validator |
getValidator()
Override this method to provide a custom
Validator . |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
SimpAnnotationMethodMessageHandler |
simpAnnotationMethodMessageHandler() |
AbstractBrokerMessageHandler |
simpleBrokerMessageHandler() |
protected org.springframework.validation.Validator |
simpValidator()
Return a
Validator s instance for validating
@Payload method arguments. |
AbstractBrokerMessageHandler |
stompBrokerRelayMessageHandler() |
UserDestinationMessageHandler |
userDestinationMessageHandler() |
UserDestinationResolver |
userDestinationResolver() |
UserSessionRegistry |
userSessionRegistry() |
protected AbstractMessageBrokerConfiguration()
@Bean public AbstractSubscribableChannel clientInboundChannel()
@Bean public org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor clientInboundChannelExecutor()
protected final ChannelRegistration getClientInboundChannelRegistration()
protected void configureClientInboundChannel(ChannelRegistration registration)
@Bean public AbstractSubscribableChannel clientOutboundChannel()
@Bean public org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor clientOutboundChannelExecutor()
protected final ChannelRegistration getClientOutboundChannelRegistration()
protected void configureClientOutboundChannel(ChannelRegistration registration)
@Bean public AbstractSubscribableChannel brokerChannel()
@Bean public org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor brokerChannelExecutor()
protected final MessageBrokerRegistry getBrokerRegistry()
MessageBrokerRegistry
that ensures its one-time creation
and initialization through configureMessageBroker(MessageBrokerRegistry)
.protected void configureMessageBroker(MessageBrokerRegistry registry)
MessageBrokerRegistry
instance.@Bean public SimpAnnotationMethodMessageHandler simpAnnotationMethodMessageHandler()
@Bean public AbstractBrokerMessageHandler simpleBrokerMessageHandler()
@Bean public AbstractBrokerMessageHandler stompBrokerRelayMessageHandler()
@Bean public UserDestinationMessageHandler userDestinationMessageHandler()
@Bean public SimpMessagingTemplate brokerMessagingTemplate()
@Bean public CompositeMessageConverter brokerMessageConverter()
protected boolean configureMessageConverters(List<MessageConverter> messageConverters)
messageConverters
- the list to add converters to, initially emptytrue
if default message converters should be added to list,
false
if no more converters should be added.@Bean public UserDestinationResolver userDestinationResolver()
@Bean public UserSessionRegistry userSessionRegistry()
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public org.springframework.context.ApplicationContext getApplicationContext()
protected org.springframework.validation.Validator simpValidator()
Validator
s instance for validating
@Payload
method arguments.
In order, this method tries to get a Validator instance:
OptionalValidatorFactoryBean
public org.springframework.validation.Validator getValidator()
Validator
.