public class UserDestinationMessageHandler extends Object implements MessageHandler, org.springframework.context.SmartLifecycle
See UserDestinationResolver
for more details and examples.
Constructor and Description |
---|
UserDestinationMessageHandler(SubscribableChannel clientInChannel,
SubscribableChannel brokerChannel,
UserDestinationResolver userDestinationResolver)
Create an instance of the handler with the given messaging template and a
user destination resolver.
|
Modifier and Type | Method and Description |
---|---|
MessageSendingOperations<String> |
getBrokerMessagingTemplate()
Return the configured messaging template for sending messages with
translated destinations.
|
MessageHeaderInitializer |
getHeaderInitializer() |
int |
getPhase() |
UserDestinationResolver |
getUserDestinationResolver()
Return the configured
UserDestinationResolver . |
void |
handleMessage(Message<?> message)
Handle the given message.
|
boolean |
isAutoStartup() |
boolean |
isRunning() |
void |
setHeaderInitializer(MessageHeaderInitializer headerInitializer)
Configure a
MessageHeaderInitializer to pass on to
HandlerMethodReturnValueHandler s
that send messages from controller return values. |
void |
start() |
void |
stop() |
void |
stop(Runnable callback) |
String |
toString() |
public UserDestinationMessageHandler(SubscribableChannel clientInChannel, SubscribableChannel brokerChannel, UserDestinationResolver userDestinationResolver)
clientInChannel
- the channel for receiving messages from clients (e.g. WebSocket clients)brokerChannel
- the channel for sending messages with translated user destinationsuserDestinationResolver
- the resolver to use to find queue suffixes for a userpublic MessageSendingOperations<String> getBrokerMessagingTemplate()
public UserDestinationResolver getUserDestinationResolver()
UserDestinationResolver
.public void setHeaderInitializer(MessageHeaderInitializer headerInitializer)
MessageHeaderInitializer
to pass on to
HandlerMethodReturnValueHandler
s
that send messages from controller return values.
By default this property is not set.
public MessageHeaderInitializer getHeaderInitializer()
public int getPhase()
getPhase
in interface org.springframework.context.Phased
public boolean isAutoStartup()
isAutoStartup
in interface org.springframework.context.SmartLifecycle
public final boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
public final void start()
start
in interface org.springframework.context.Lifecycle
public final void stop()
stop
in interface org.springframework.context.Lifecycle
public final void stop(Runnable callback)
stop
in interface org.springframework.context.SmartLifecycle
public void handleMessage(Message<?> message) throws MessagingException
MessageHandler
handleMessage
in interface MessageHandler
message
- the message to be handledMessagingException