Top Description Fields Constructors Methods
org.springframework.messaging.core

public abstract Class AbstractDestinationResolvingMessagingTemplate<D>

extends AbstractMessagingTemplate<D>
implements DestinationResolvingMessageSendingOperations<D>, DestinationResolvingMessageReceivingOperations<D>, DestinationResolvingMessageRequestReplyOperations<D>
Class Inheritance
All Implemented Interfaces
org.springframework.messaging.core.DestinationResolvingMessageRequestReplyOperations, org.springframework.messaging.core.MessageRequestReplyOperations, org.springframework.messaging.core.DestinationResolvingMessageReceivingOperations, org.springframework.messaging.core.MessageReceivingOperations, org.springframework.messaging.core.DestinationResolvingMessageSendingOperations, org.springframework.messaging.core.MessageSendingOperations
Known Direct Subclasses
org.springframework.messaging.core.GenericMessagingTemplate
Type Parameters
<D>
the destination type
Imports
java.util.Map, org.springframework.lang.Nullable, org.springframework.messaging.Message, org.springframework.util.Assert

An extension of AbstractMessagingTemplate that adds operations for sending messages to a resolvable destination name. Supports destination resolving as defined by the following interfaces:
Authors
Mark Fisher, Rossen Stoyanchev
Since
4.0

Field Summary

Modifier and TypeField and Description
private DestinationResolver<D>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public <T> void
convertAndSend(String
the destination name to resolve
destinationName
,
T
the Object to use as payload
payload
)

Implements org.springframework.messaging.core.DestinationResolvingMessageSendingOperations.convertAndSend.

Resolve the given destination name to a destination, convert the payload Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message and send it to the resolved destination.

public <T> void
convertAndSend(String
the destination name to resolve
destinationName
,
T
the Object to use as payload
payload
,
Map<String, Object>
the headers for the message to send
headers
)

Implements org.springframework.messaging.core.DestinationResolvingMessageSendingOperations.convertAndSend.

Resolve the given destination name to a destination, convert the payload Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message with the given headers and send it to the resolved destination.

public <T> void
convertAndSend(String
the destination name to resolve
destinationName
,
T
the Object to use as payload
payload
,
MessagePostProcessor
the post processor to apply to the message
postProcessor
)

Implements org.springframework.messaging.core.DestinationResolvingMessageSendingOperations.convertAndSend.

Resolve the given destination name to a destination, convert the payload Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message, apply the given post processor, and send the resulting message to the resolved destination.

public <T> void
convertAndSend(String
the destination name to resolve
destinationName
,
T
the Object to use as payload
payload
,
Map<String, Object>
the headers for the message to send
headers
,
MessagePostProcessor
the post processor to apply to the message
postProcessor
)

Implements org.springframework.messaging.core.DestinationResolvingMessageSendingOperations.convertAndSend.

Resolve the given destination name to a destination, convert the payload Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message with the given headers, apply the given post processor, and send the resulting message to the resolved destination.

public <T> T
convertSendAndReceive(String
the name of the target destination
destinationName
,
Object
the payload for the request message to send
request
,
Class<T>
the target class to convert the payload of the reply to
targetClass
)

Overrides org.springframework.messaging.core.AbstractMessagingTemplate.convertSendAndReceive.

Implements org.springframework.messaging.core.DestinationResolvingMessageRequestReplyOperations.convertSendAndReceive, org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Resolve the given destination name, convert the payload request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message and send it to the resolved destination, receive a reply and convert its body to the specified target class.

public <T> T
convertSendAndReceive(String
the name of the target destination
destinationName
,
Object
the payload for the request message to send
request
,
Map<String, Object>
the headers for the request message to send
headers
,
Class<T>
the target class to convert the payload of the reply to
targetClass
)

Overrides org.springframework.messaging.core.AbstractMessagingTemplate.convertSendAndReceive.

Implements org.springframework.messaging.core.DestinationResolvingMessageRequestReplyOperations.convertSendAndReceive, org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Resolve the given destination name, convert the payload request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message with the given headers and send it to the resolved destination, receive a reply and convert its body to the specified target class.

public <T> T
convertSendAndReceive(String
the name of the target destination
destinationName
,
Object
the payload for the request message to send
request
,
Class<T>
the target class to convert the payload of the reply to
targetClass
,
MessagePostProcessor
post process for the request message
postProcessor
)

Overrides org.springframework.messaging.core.AbstractMessagingTemplate.convertSendAndReceive.

Implements org.springframework.messaging.core.DestinationResolvingMessageRequestReplyOperations.convertSendAndReceive, org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Resolve the given destination name, convert the payload request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message, apply the given post process, and send the resulting message to the resolved destination, then receive a reply and convert its body to the specified target class.

public <T> T
convertSendAndReceive(String
the name of the target destination
destinationName
,
Object
the payload for the request message to send
request
,
Map<String, Object>
the headers for the request message to send
headers
,
Class<T>
the target class to convert the payload of the reply to
targetClass
,
MessagePostProcessor
post process for the request message
postProcessor
)

Overrides org.springframework.messaging.core.AbstractMessagingTemplate.convertSendAndReceive.

Implements org.springframework.messaging.core.DestinationResolvingMessageRequestReplyOperations.convertSendAndReceive, org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Resolve the given destination name, convert the payload request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message with the given headers, apply the given post process, and send the resulting message to the resolved destination, then receive a reply and convert its body to the specified target class.

public DestinationResolver<D>
getDestinationResolver()

Return the configured destination resolver.

public Message<?>
public <T> T
receiveAndConvert(String
the destination name to resolve
destinationName
,
Class<T>
the target class for the converted payload
targetClass
)

Overrides org.springframework.messaging.core.AbstractMessageReceivingTemplate.receiveAndConvert.

Implements org.springframework.messaging.core.DestinationResolvingMessageReceivingOperations.receiveAndConvert, org.springframework.messaging.core.MessageReceivingOperations.receiveAndConvert.

Resolve the given destination name, receive a message from it, convert the payload to the specified target type.

protected final D
resolveDestination(String destinationName)

public void
send(String
the destination name to resolve
destinationName
,
Message<?>
the message to send
message
)

Overrides org.springframework.messaging.core.AbstractMessageSendingTemplate.send.

Implements org.springframework.messaging.core.DestinationResolvingMessageSendingOperations.send, org.springframework.messaging.core.MessageSendingOperations.send.

Resolve the given destination name to a destination and send a message to it.

public Message<?>
sendAndReceive(String
the name of the target destination
destinationName
,
Message<?>
the message to send
requestMessage
)

Overrides org.springframework.messaging.core.AbstractMessagingTemplate.sendAndReceive.

Implements org.springframework.messaging.core.DestinationResolvingMessageRequestReplyOperations.sendAndReceive, org.springframework.messaging.core.MessageRequestReplyOperations.sendAndReceive.

Resolve the given destination name to a destination and send the given message, receive a reply and return it.

public void
setDestinationResolver(DestinationResolver<D>
the destination resolver to use
destinationResolver
)

Configure the DestinationResolver to use to resolve String destination names into actual destinations of type <D>.

Inherited from org.springframework.messaging.core.AbstractMessagingTemplate:
convertSendAndReceiveconvertSendAndReceivedoSendAndReceivesendAndReceive

Field Detail

destinationResolverback to summary
private DestinationResolver<D> destinationResolver
Annotations
@Nullable

Constructor Detail

AbstractDestinationResolvingMessagingTemplateback to summary
public AbstractDestinationResolvingMessagingTemplate()

Method Detail

convertAndSendback to summary
public <T> void convertAndSend(String destinationName, T payload)

Implements org.springframework.messaging.core.DestinationResolvingMessageSendingOperations.convertAndSend.

Doc from org.springframework.messaging.core.DestinationResolvingMessageSendingOperations.convertAndSend.

Resolve the given destination name to a destination, convert the payload Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message and send it to the resolved destination.

Parameters
destinationName:String

the destination name to resolve

payload:T

the Object to use as payload

Annotations
@Override
convertAndSendback to summary
public <T> void convertAndSend(String destinationName, T payload, Map<String, Object> headers)

Implements org.springframework.messaging.core.DestinationResolvingMessageSendingOperations.convertAndSend.

Doc from org.springframework.messaging.core.DestinationResolvingMessageSendingOperations.convertAndSend.

Resolve the given destination name to a destination, convert the payload Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message with the given headers and send it to the resolved destination.

Parameters
destinationName:String

the destination name to resolve

payload:T

the Object to use as payload

headers:Map<String, Object>

the headers for the message to send

Annotations
@Override
convertAndSendback to summary
public <T> void convertAndSend(String destinationName, T payload, MessagePostProcessor postProcessor)

Implements org.springframework.messaging.core.DestinationResolvingMessageSendingOperations.convertAndSend.

Doc from org.springframework.messaging.core.DestinationResolvingMessageSendingOperations.convertAndSend.

Resolve the given destination name to a destination, convert the payload Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message, apply the given post processor, and send the resulting message to the resolved destination.

Parameters
destinationName:String

the destination name to resolve

payload:T

the Object to use as payload

postProcessor:MessagePostProcessor

the post processor to apply to the message

Annotations
@Override
convertAndSendback to summary
public <T> void convertAndSend(String destinationName, T payload, Map<String, Object> headers, MessagePostProcessor postProcessor)

Implements org.springframework.messaging.core.DestinationResolvingMessageSendingOperations.convertAndSend.

Doc from org.springframework.messaging.core.DestinationResolvingMessageSendingOperations.convertAndSend.

Resolve the given destination name to a destination, convert the payload Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message with the given headers, apply the given post processor, and send the resulting message to the resolved destination.

Parameters
destinationName:String

the destination name to resolve

payload:T

the Object to use as payload

headers:Map<String, Object>

the headers for the message to send

postProcessor:MessagePostProcessor

the post processor to apply to the message

Annotations
@Override
convertSendAndReceiveback to summary
public <T> T convertSendAndReceive(String destinationName, Object request, Class<T> targetClass)

Overrides org.springframework.messaging.core.AbstractMessagingTemplate.convertSendAndReceive.

Implements org.springframework.messaging.core.DestinationResolvingMessageRequestReplyOperations.convertSendAndReceive, org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Doc from org.springframework.messaging.core.DestinationResolvingMessageRequestReplyOperations.convertSendAndReceive.

Resolve the given destination name, convert the payload request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message and send it to the resolved destination, receive a reply and convert its body to the specified target class.

Parameters
destinationName:String

the name of the target destination

request:Object

the payload for the request message to send

targetClass:Class<T>

the target class to convert the payload of the reply to

Returns:T

the converted payload of the reply message, possibly null if the message could not be received, for example due to a timeout

Annotations
@Override
@Nullable
convertSendAndReceiveback to summary
public <T> T convertSendAndReceive(String destinationName, Object request, Map<String, Object> headers, Class<T> targetClass)

Overrides org.springframework.messaging.core.AbstractMessagingTemplate.convertSendAndReceive.

Implements org.springframework.messaging.core.DestinationResolvingMessageRequestReplyOperations.convertSendAndReceive, org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Doc from org.springframework.messaging.core.DestinationResolvingMessageRequestReplyOperations.convertSendAndReceive.

Resolve the given destination name, convert the payload request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message with the given headers and send it to the resolved destination, receive a reply and convert its body to the specified target class.

Parameters
destinationName:String

the name of the target destination

request:Object

the payload for the request message to send

headers:Map<String, Object>

the headers for the request message to send

targetClass:Class<T>

the target class to convert the payload of the reply to

Returns:T

the converted payload of the reply message, possibly null if the message could not be received, for example due to a timeout

Annotations
@Override
@Nullable
convertSendAndReceiveback to summary
public <T> T convertSendAndReceive(String destinationName, Object request, Class<T> targetClass, MessagePostProcessor postProcessor)

Overrides org.springframework.messaging.core.AbstractMessagingTemplate.convertSendAndReceive.

Implements org.springframework.messaging.core.DestinationResolvingMessageRequestReplyOperations.convertSendAndReceive, org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Doc from org.springframework.messaging.core.DestinationResolvingMessageRequestReplyOperations.convertSendAndReceive.

Resolve the given destination name, convert the payload request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message, apply the given post process, and send the resulting message to the resolved destination, then receive a reply and convert its body to the specified target class.

Parameters
destinationName:String

the name of the target destination

request:Object

the payload for the request message to send

targetClass:Class<T>

the target class to convert the payload of the reply to

postProcessor:MessagePostProcessor

post process for the request message

Returns:T

the converted payload of the reply message, possibly null if the message could not be received, for example due to a timeout

Annotations
@Override
@Nullable
convertSendAndReceiveback to summary
public <T> T convertSendAndReceive(String destinationName, Object request, Map<String, Object> headers, Class<T> targetClass, MessagePostProcessor postProcessor)

Overrides org.springframework.messaging.core.AbstractMessagingTemplate.convertSendAndReceive.

Implements org.springframework.messaging.core.DestinationResolvingMessageRequestReplyOperations.convertSendAndReceive, org.springframework.messaging.core.MessageRequestReplyOperations.convertSendAndReceive.

Doc from org.springframework.messaging.core.DestinationResolvingMessageRequestReplyOperations.convertSendAndReceive.

Resolve the given destination name, convert the payload request Object to serialized form, possibly using a org.springframework.messaging.converter.MessageConverter, wrap it as a message with the given headers, apply the given post process, and send the resulting message to the resolved destination, then receive a reply and convert its body to the specified target class.

Parameters
destinationName:String

the name of the target destination

request:Object

the payload for the request message to send

headers:Map<String, Object>

the headers for the request message to send

targetClass:Class<T>

the target class to convert the payload of the reply to

postProcessor:MessagePostProcessor

post process for the request message

Returns:T

the converted payload of the reply message, possibly null if the message could not be received, for example due to a timeout

Annotations
@Override
@Nullable
getDestinationResolverback to summary
public DestinationResolver<D> getDestinationResolver()

Return the configured destination resolver.

Annotations
@Nullable
receiveback to summary
public Message<?> receive(String destinationName)

Overrides org.springframework.messaging.core.AbstractMessageReceivingTemplate.receive.

Implements org.springframework.messaging.core.DestinationResolvingMessageReceivingOperations.receive, org.springframework.messaging.core.MessageReceivingOperations.receive.

Doc from org.springframework.messaging.core.DestinationResolvingMessageReceivingOperations.receive.

Resolve the given destination name and receive a message from it.

Parameters
destinationName:String

the destination name to resolve

Returns:Message<?>

Doc from org.springframework.messaging.core.MessageReceivingOperations.receive.

the received message, possibly null if the message could not be received, for example due to a timeout

Annotations
@Override
@Nullable
receiveAndConvertback to summary
public <T> T receiveAndConvert(String destinationName, Class<T> targetClass)

Overrides org.springframework.messaging.core.AbstractMessageReceivingTemplate.receiveAndConvert.

Implements org.springframework.messaging.core.DestinationResolvingMessageReceivingOperations.receiveAndConvert, org.springframework.messaging.core.MessageReceivingOperations.receiveAndConvert.

Doc from org.springframework.messaging.core.DestinationResolvingMessageReceivingOperations.receiveAndConvert.

Resolve the given destination name, receive a message from it, convert the payload to the specified target type.

Parameters
destinationName:String

the destination name to resolve

targetClass:Class<T>

the target class for the converted payload

Returns:T

Doc from org.springframework.messaging.core.MessageReceivingOperations.receiveAndConvert.

the converted payload of the reply message, possibly null if the message could not be received, for example due to a timeout

Annotations
@Override
@Nullable
resolveDestinationback to summary
protected final D resolveDestination(String destinationName)
sendback to summary
public void send(String destinationName, Message<?> message)

Overrides org.springframework.messaging.core.AbstractMessageSendingTemplate.send.

Implements org.springframework.messaging.core.DestinationResolvingMessageSendingOperations.send, org.springframework.messaging.core.MessageSendingOperations.send.

Doc from org.springframework.messaging.core.DestinationResolvingMessageSendingOperations.send.

Resolve the given destination name to a destination and send a message to it.

Parameters
destinationName:String

the destination name to resolve

message:Message<?>

the message to send

Annotations
@Override
sendAndReceiveback to summary
public Message<?> sendAndReceive(String destinationName, Message<?> requestMessage)

Overrides org.springframework.messaging.core.AbstractMessagingTemplate.sendAndReceive.

Implements org.springframework.messaging.core.DestinationResolvingMessageRequestReplyOperations.sendAndReceive, org.springframework.messaging.core.MessageRequestReplyOperations.sendAndReceive.

Doc from org.springframework.messaging.core.DestinationResolvingMessageRequestReplyOperations.sendAndReceive.

Resolve the given destination name to a destination and send the given message, receive a reply and return it.

Parameters
destinationName:String

the name of the target destination

requestMessage:Message<?>

the message to send

Returns:Message<?>

the received message, possibly null if the message could not be received, for example due to a timeout

Annotations
@Override
@Nullable
setDestinationResolverback to summary
public void setDestinationResolver(DestinationResolver<D> destinationResolver)

Configure the DestinationResolver to use to resolve String destination names into actual destinations of type <D>.

This field does not have a default setting. If not configured, methods that require resolving a destination name will raise an IllegalArgumentException.

Parameters
destinationResolver:DestinationResolver<D>

the destination resolver to use