SimpAnnotationMethodMessageHandler

A handler for messages delegating to {@link MessageMapping @MessageMapping} and {@link SubscribeMapping @SubscribeMapping} annotated methods.

<p>Supports Ant-style path patterns with template variables.

@author Rossen Stoyanchev @author Brian Clozel @author Juergen Hoeller @since 4.0

Constructors

this
this(SubscribableChannel clientInboundChannel, MessageChannel clientOutboundChannel, SimpMessageSendingOperations brokerTemplate)

Create an instance of SimpAnnotationMethodMessageHandler with the given message channels and broker messaging template. @param clientInboundChannel the channel for receiving messages from clients (e.g. WebSocket clients) @param clientOutboundChannel the channel for messages to clients (e.g. WebSocket clients) @param brokerTemplate a messaging template to send application messages to the broker

Members

Functions

getDestination
string getDestination(MessageBase message)

Resolve placeholder values in the given array of destinations. @return a new array with updated destinations @since 4.2

getHeaderInitializer
MessageHeaderInitializer getHeaderInitializer()

Return the configured header initializer.

getLookupDestination
string getLookupDestination(string destination)
Undocumented in source. Be warned that the author may not have intended to support it.
getMessageConverter
MessageConverter getMessageConverter()

Return the configured {@link MessageConverter}.

getPathMatcher
PathMatcher getPathMatcher()

Return the PathMatcher implementation to use for matching destinations.

getPhase
int getPhase()
Undocumented in source. Be warned that the author may not have intended to support it.
handleReturnValue
void handleReturnValue(Object returnValue, TypeInfo returnType, MessageBase message, string[] destinations)
Undocumented in source. Be warned that the author may not have intended to support it.
isAutoStartup
bool isAutoStartup()
Undocumented in source. Be warned that the author may not have intended to support it.
isRunning
bool isRunning()
Undocumented in source. Be warned that the author may not have intended to support it.
setDestinationPrefixes
void setDestinationPrefixes(string[] prefixes)

{@inheritDoc} <p>Destination prefixes are expected to be slash-separated Strings and therefore a slash is automatically appended where missing to ensure a proper prefix-based match (i.e. matching complete segments). <p>Note however that the remaining portion of a destination after the prefix may use a different separator (e.g. commonly "." in messaging) depending on the configured {@code PathMatcher}.

setHeaderInitializer
void setHeaderInitializer(MessageHeaderInitializer headerInitializer)

Configure a {@link MessageHeaderInitializer} to pass on to {@link HandlerMethodReturnValueHandler HandlerMethodReturnValueHandlers} that send messages from controller return values. <p>By default, this property is not set.

setMessageConverter
void setMessageConverter(MessageConverter converter)

Configure a {@link MessageConverter} to use to convert the payload of a message from its serialized form with a specific MIME type to an Object matching the target method parameter. The converter is also used when sending a message to the message broker. @see CompositeMessageConverter

setPathMatcher
void setPathMatcher(PathMatcher pathMatcher)

Set the PathMatcher implementation to use for matching destinations against configured destination patterns. <p>By default, {@link AntPathMatcher} is used.

start
void start()
Undocumented in source. Be warned that the author may not have intended to support it.
stop
void stop()
Undocumented in source. Be warned that the author may not have intended to support it.
stop
void stop(Runnable callback)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta