public abstract class AbstractMessageBrokerConfiguration extends Object implements ApplicationContextAware
clientInboundChannel()
and clientOutboundChannel()
deliver
messages to and from remote clients to several message handlers such as the
following.
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.
Subclasses are responsible for the parts 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.
|
protected AbstractMessageBrokerConfiguration()
public void setApplicationContext(ApplicationContext applicationContext)
ApplicationContextAware
Invoked after population of normal bean properties but before an init callback such
as InitializingBean.afterPropertiesSet()
or a custom init-method. Invoked after ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader)
,
ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher)
and
MessageSourceAware
, if applicable.
setApplicationContext
in interface ApplicationContextAware
applicationContext
- the ApplicationContext object to be used by this objectBeanInitializationException
public ApplicationContext getApplicationContext()
@Bean public AbstractSubscribableChannel clientInboundChannel()
@Bean public ThreadPoolTaskExecutor clientInboundChannelExecutor()
protected final ChannelRegistration getClientInboundChannelRegistration()
protected void configureClientInboundChannel(ChannelRegistration registration)
@Bean public AbstractSubscribableChannel clientOutboundChannel()
@Bean public ThreadPoolTaskExecutor clientOutboundChannelExecutor()
protected final ChannelRegistration getClientOutboundChannelRegistration()
protected void configureClientOutboundChannel(ChannelRegistration registration)
@Bean public AbstractSubscribableChannel brokerChannel()
@Bean public 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.public final PathMatcher getPathMatcher()
@Bean public SimpAnnotationMethodMessageHandler simpAnnotationMethodMessageHandler()
protected SimpAnnotationMethodMessageHandler createAnnotationMethodMessageHandler()
SimpAnnotationMethodMessageHandler
.protected void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers)
protected void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers)
@Bean public AbstractBrokerMessageHandler simpleBrokerMessageHandler()
@Bean public AbstractBrokerMessageHandler stompBrokerRelayMessageHandler()
@Bean public UserDestinationMessageHandler userDestinationMessageHandler()
@Bean public MessageHandler userRegistryMessageHandler()
@Bean(name={"messageBrokerTaskScheduler","messageBrokerSockJsTaskScheduler"}) public ThreadPoolTaskScheduler messageBrokerTaskScheduler()
@Bean public SimpMessagingTemplate brokerMessagingTemplate()
@Bean public CompositeMessageConverter brokerMessageConverter()
protected MappingJackson2MessageConverter createJacksonConverter()
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 SimpUserRegistry userRegistry()
protected abstract SimpUserRegistry createLocalUserRegistry()
@Deprecated protected UserSessionRegistry userSessionRegistry()
UserSessionRegistry
is deprecated in favor of SimpUserRegistry
exposing information about all connected users. The MultiServerUserRegistry
implementation in combination with UserRegistryMessageHandler
can be used
to share user registries across multiple servers.protected Validator simpValidator()
Validator
s instance for validating
@Payload
method arguments.
In order, this method tries to get a Validator instance:
OptionalValidatorFactoryBean