Class MessagingTemplate
java.lang.Object
org.springframework.messaging.core.AbstractMessageSendingTemplate<MessageChannel>
org.springframework.messaging.core.AbstractMessageReceivingTemplate<MessageChannel>
org.springframework.messaging.core.AbstractMessagingTemplate<MessageChannel>
org.springframework.messaging.core.AbstractDestinationResolvingMessagingTemplate<MessageChannel>
org.springframework.messaging.core.GenericMessagingTemplate
org.springframework.integration.core.MessagingTemplate
- All Implemented Interfaces:
Aware,BeanFactoryAware,DestinationResolvingMessageReceivingOperations<MessageChannel>,DestinationResolvingMessageRequestReplyOperations<MessageChannel>,DestinationResolvingMessageSendingOperations<MessageChannel>,MessageReceivingOperations<MessageChannel>,MessageRequestReplyOperations<MessageChannel>,MessageSendingOperations<MessageChannel>
- Direct Known Subclasses:
AsyncMessagingTemplate,MessagingGatewaySupport.ConvertingMessagingTemplate
- Since:
- 1.0
- Author:
- Mark Fisher, Oleg Zhurakousky, Gary Russell, Artem Bilan, Christian Tzolov
-
Field Summary
Fields inherited from class org.springframework.messaging.core.GenericMessagingTemplate
DEFAULT_RECEIVE_TIMEOUT_HEADER, DEFAULT_SEND_TIMEOUT_HEADERFields inherited from class org.springframework.messaging.core.AbstractMessageSendingTemplate
CONVERSION_HINT_HEADER, logger -
Constructor Summary
ConstructorsConstructorDescriptionCreate a MessagingTemplate with no default channel.MessagingTemplate(MessageChannel defaultChannel) Create a MessagingTemplate with the given default channel. -
Method Summary
Modifier and TypeMethodDescription@Nullable Message<?> receive(MessageChannel destination, long timeout) @Nullable ObjectreceiveAndConvert(MessageChannel destination, long timeout) @Nullable Message<?> sendAndReceive(MessageChannel destination, Message<?> requestMessage) voidsetBeanFactory(BeanFactory beanFactory) Overridden to set the destination resolver to aintegrationChannelResolverbean.voidsetDefaultChannel(@Nullable MessageChannel channel) InvokessetDefaultDestination(MessageChannel)- provided for backward compatibility.voidsetThrowExceptionOnLateReply(boolean throwExceptionOnLateReply) Methods inherited from class org.springframework.messaging.core.GenericMessagingTemplate
doReceive, doReceive, doSend, doSend, doSendAndReceive, getReceiveTimeout, getReceiveTimeoutHeader, getSendTimeout, getSendTimeoutHeader, setReceiveTimeout, setReceiveTimeoutHeader, setSendTimeout, setSendTimeoutHeaderMethods inherited from class org.springframework.messaging.core.AbstractDestinationResolvingMessagingTemplate
convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, getDestinationResolver, receive, receiveAndConvert, resolveDestination, send, sendAndReceive, setDestinationResolverMethods inherited from class org.springframework.messaging.core.AbstractMessagingTemplate
convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, sendAndReceiveMethods inherited from class org.springframework.messaging.core.AbstractMessageReceivingTemplate
doConvert, receive, receive, receiveAndConvert, receiveAndConvertMethods inherited from class org.springframework.messaging.core.AbstractMessageSendingTemplate
convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, doConvert, getDefaultDestination, getMessageConverter, getRequiredDefaultDestination, processHeadersToSend, send, send, setDefaultDestination, setMessageConverterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.messaging.core.MessageReceivingOperations
receive, receive, receiveAndConvert, receiveAndConvertMethods inherited from interface org.springframework.messaging.core.MessageRequestReplyOperations
convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, sendAndReceiveMethods inherited from interface org.springframework.messaging.core.MessageSendingOperations
convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, send, send
-
Constructor Details
-
MessagingTemplate
public MessagingTemplate()Create a MessagingTemplate with no default channel. Note, that one may be provided by invokingsetDefaultChannel(MessageChannel). -
MessagingTemplate
Create a MessagingTemplate with the given default channel.- Parameters:
defaultChannel- the defaultMessageChannelforsendoperations
-
-
Method Details
-
setBeanFactory
Overridden to set the destination resolver to aintegrationChannelResolverbean.- Specified by:
setBeanFactoryin interfaceBeanFactoryAware- Overrides:
setBeanFactoryin classGenericMessagingTemplate- Throws:
BeansException
-
setThrowExceptionOnLateReply
public void setThrowExceptionOnLateReply(boolean throwExceptionOnLateReply) - Overrides:
setThrowExceptionOnLateReplyin classGenericMessagingTemplate
-
setDefaultChannel
InvokessetDefaultDestination(MessageChannel)- provided for backward compatibility.- Parameters:
channel- the channel to set.
-
sendAndReceive
- Specified by:
sendAndReceivein interfaceMessageRequestReplyOperations<MessageChannel>- Overrides:
sendAndReceivein classAbstractMessagingTemplate<MessageChannel>
-
receiveAndConvert
-
receive
-