public class SimpMessagingTemplate extends AbstractMessageSendingTemplate<String> implements SimpMessageSendingOperations
AbstractMessageSendingTemplate that adds String-based
destinations as a message header.logger| Constructor and Description |
|---|
SimpMessagingTemplate(MessageChannel messageChannel)
Create a new
SimpMessagingTemplate instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
convertAndSendToUser(String user,
String destination,
Object payload)
Send a message to a specific user.
|
void |
convertAndSendToUser(String user,
String destination,
Object payload,
Map<String,Object> headers)
Send a message to a specific user.
|
void |
convertAndSendToUser(String user,
String destination,
Object payload,
Map<String,Object> headers,
MessagePostProcessor postProcessor)
Send a message to a specific user.
|
void |
convertAndSendToUser(String user,
String destination,
Object payload,
MessagePostProcessor postProcessor)
Send a message to a specific user.
|
protected void |
doSend(String destination,
Message<?> message) |
MessageChannel |
getMessageChannel() |
long |
getSendTimeout() |
String |
getUserDestinationPrefix() |
void |
send(Message<?> message)
Send a message to a default destination.
|
void |
setSendTimeout(long sendTimeout)
Specify the timeout value to use for send operations.
|
void |
setUserDestinationPrefix(String prefix)
Configure the prefix to use for destinations targeting a specific user.
|
convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, getDefaultDestination, getMessageConverter, getRequiredDefaultDestination, send, setDefaultDestination, setMessageConverterclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconvertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, sendpublic SimpMessagingTemplate(MessageChannel messageChannel)
SimpMessagingTemplate instance.messageChannel - the message channel (must not be null)public void setUserDestinationPrefix(String prefix)
The default value is "/user/".
UserDestinationMessageHandlerpublic String getUserDestinationPrefix()
public MessageChannel getMessageChannel()
public void setSendTimeout(long sendTimeout)
sendTimeout - the send timeout in millisecondspublic long getSendTimeout()
public void send(Message<?> message)
MessageSendingOperationssend in interface MessageSendingOperations<String>send in class AbstractMessageSendingTemplate<String>message - the message to sendprotected void doSend(String destination, Message<?> message)
doSend in class AbstractMessageSendingTemplate<String>public void convertAndSendToUser(String user, String destination, Object payload) throws MessagingException
SimpMessageSendingOperationsconvertAndSendToUser in interface SimpMessageSendingOperationsuser - the user that should receive the message.destination - the destination to send the message to.payload - the payload to sendMessagingExceptionpublic void convertAndSendToUser(String user, String destination, Object payload, Map<String,Object> headers) throws MessagingException
SimpMessageSendingOperationsconvertAndSendToUser in interface SimpMessageSendingOperationsuser - the user that should receive the message.destination - the destination to send the message to.payload - the payload to sendheaders - the message headersMessagingExceptionpublic void convertAndSendToUser(String user, String destination, Object payload, MessagePostProcessor postProcessor) throws MessagingException
SimpMessageSendingOperationsconvertAndSendToUser in interface SimpMessageSendingOperationsuser - the user that should receive the message.destination - the destination to send the message to.payload - the payload to sendpostProcessor - a postProcessor to post-process or modify the created messageMessagingExceptionpublic void convertAndSendToUser(String user, String destination, Object payload, Map<String,Object> headers, MessagePostProcessor postProcessor) throws MessagingException
SimpMessageSendingOperationsconvertAndSendToUser in interface SimpMessageSendingOperationsuser - the user that should receive the message.destination - the destination to send the message to.payload - the payload to sendheaders - the message headerspostProcessor - a postProcessor to post-process or modify the created messageMessagingException