Class MessagingTemplate
java.lang.Object
org.springframework.messaging.core.AbstractMessageSendingTemplate<D>
org.springframework.messaging.core.AbstractMessageReceivingTemplate<D>
org.springframework.messaging.core.AbstractMessagingTemplate<D>
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 SummaryFields inherited from class org.springframework.messaging.core.GenericMessagingTemplateDEFAULT_RECEIVE_TIMEOUT_HEADER, DEFAULT_SEND_TIMEOUT_HEADERFields inherited from class org.springframework.messaging.core.AbstractMessageSendingTemplateCONVERSION_HINT_HEADER, logger
- 
Constructor SummaryConstructorsConstructorDescriptionCreate a MessagingTemplate with no default channel.MessagingTemplate(MessageChannel defaultChannel) Create a MessagingTemplate with the given default channel.
- 
Method SummaryModifier and TypeMethodDescriptionMessage<?>receive(MessageChannel destination, long timeout) receiveAndConvert(MessageChannel destination, long timeout) Message<?>sendAndReceive(MessageChannel destination, Message<?> requestMessage) voidsetBeanFactory(BeanFactory beanFactory) Overridden to set the destination resolver to aintegrationChannelResolverbean.voidsetDefaultChannel(MessageChannel channel) InvokessetDefaultDestination(MessageChannel)- provided for backward compatibility.voidsetThrowExceptionOnLateReply(boolean throwExceptionOnLateReply) Methods inherited from class org.springframework.messaging.core.GenericMessagingTemplatedoReceive, doReceive, doSend, doSend, doSendAndReceive, getReceiveTimeout, getReceiveTimeoutHeader, getSendTimeout, getSendTimeoutHeader, setReceiveTimeout, setReceiveTimeoutHeader, setSendTimeout, setSendTimeoutHeaderMethods inherited from class org.springframework.messaging.core.AbstractDestinationResolvingMessagingTemplateconvertAndSend, convertAndSend, convertAndSend, convertAndSend, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, getDestinationResolver, receive, receiveAndConvert, resolveDestination, send, sendAndReceive, setDestinationResolverMethods inherited from class org.springframework.messaging.core.AbstractMessagingTemplateconvertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, sendAndReceiveMethods inherited from class org.springframework.messaging.core.AbstractMessageReceivingTemplatedoConvert, receive, receive, receiveAndConvert, receiveAndConvertMethods inherited from class org.springframework.messaging.core.AbstractMessageSendingTemplateconvertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, doConvert, getDefaultDestination, getMessageConverter, getRequiredDefaultDestination, processHeadersToSend, send, send, setDefaultDestination, setMessageConverterMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.messaging.core.MessageReceivingOperationsreceive, receive, receiveAndConvert, receiveAndConvertMethods inherited from interface org.springframework.messaging.core.MessageRequestReplyOperationsconvertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, sendAndReceiveMethods inherited from interface org.springframework.messaging.core.MessageSendingOperationsconvertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, send, send
- 
Constructor Details- 
MessagingTemplatepublic MessagingTemplate()Create a MessagingTemplate with no default channel. Note, that one may be provided by invokingsetDefaultChannel(MessageChannel).
- 
MessagingTemplateCreate a MessagingTemplate with the given default channel.- Parameters:
- defaultChannel- the default- MessageChannelfor- sendoperations
 
 
- 
- 
Method Details- 
setBeanFactoryOverridden to set the destination resolver to aintegrationChannelResolverbean.- Specified by:
- setBeanFactoryin interface- BeanFactoryAware
- Overrides:
- setBeanFactoryin class- GenericMessagingTemplate
- Throws:
- BeansException
 
- 
setThrowExceptionOnLateReplypublic void setThrowExceptionOnLateReply(boolean throwExceptionOnLateReply) - Overrides:
- setThrowExceptionOnLateReplyin class- GenericMessagingTemplate
 
- 
setDefaultChannelInvokessetDefaultDestination(MessageChannel)- provided for backward compatibility.- Parameters:
- channel- the channel to set.
 
- 
sendAndReceive- Specified by:
- sendAndReceivein interface- MessageRequestReplyOperations<MessageChannel>
- Overrides:
- sendAndReceivein class- AbstractMessagingTemplate<MessageChannel>
 
- 
receiveAndConvert
- 
receive
 
-