public class UserDestinationMessageHandler extends Object implements MessageHandler, org.springframework.context.SmartLifecycle
See UserDestinationResolver for more details and examples.
| Modifier and Type | Field and Description |
|---|---|
static String |
SUBSCRIBE_DESTINATION |
| 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.
|
int |
getPhase() |
UserDestinationResolver |
getUserDestinationResolver()
Return the configured
UserDestinationResolver. |
void |
handleMessage(Message<?> message)
Handle the given message.
|
boolean |
isAutoStartup() |
boolean |
isRunning() |
void |
start() |
void |
stop() |
void |
stop(Runnable callback) |
public static final String SUBSCRIBE_DESTINATION
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 int getPhase()
getPhase in interface org.springframework.context.Phasedpublic boolean isAutoStartup()
isAutoStartup in interface org.springframework.context.SmartLifecyclepublic final boolean isRunning()
isRunning in interface org.springframework.context.Lifecyclepublic final void start()
start in interface org.springframework.context.Lifecyclepublic final void stop()
stop in interface org.springframework.context.Lifecyclepublic final void stop(Runnable callback)
stop in interface org.springframework.context.SmartLifecyclepublic void handleMessage(Message<?> message) throws MessagingException
MessageHandlerhandleMessage in interface MessageHandlermessage - the message to be handledMessagingException