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<org.springframework.messaging.MessageChannel>
org.springframework.messaging.core.GenericMessagingTemplate
org.springframework.integration.core.MessagingTemplate
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.messaging.core.DestinationResolvingMessageReceivingOperations<org.springframework.messaging.MessageChannel>, org.springframework.messaging.core.DestinationResolvingMessageRequestReplyOperations<org.springframework.messaging.MessageChannel>, org.springframework.messaging.core.DestinationResolvingMessageSendingOperations<org.springframework.messaging.MessageChannel>, org.springframework.messaging.core.MessageReceivingOperations<org.springframework.messaging.MessageChannel>, org.springframework.messaging.core.MessageRequestReplyOperations<org.springframework.messaging.MessageChannel>, org.springframework.messaging.core.MessageSendingOperations<org.springframework.messaging.MessageChannel>
Direct Known Subclasses:
AsyncMessagingTemplate

public class MessagingTemplate
extends org.springframework.messaging.core.GenericMessagingTemplate
Since:
1.0
  • Field Summary

    Fields inherited from class org.springframework.messaging.core.GenericMessagingTemplate

    DEFAULT_RECEIVE_TIMEOUT_HEADER, DEFAULT_SEND_TIMEOUT_HEADER

    Fields inherited from class org.springframework.messaging.core.AbstractMessageSendingTemplate

    CONVERSION_HINT_HEADER, logger
  • Constructor Summary

    Constructors 
    Constructor Description
    MessagingTemplate()
    Create a MessagingTemplate with no default channel.
    MessagingTemplate​(org.springframework.messaging.MessageChannel defaultChannel)
    Create a MessagingTemplate with the given default channel.
  • Method Summary

    Modifier and Type Method Description
    org.springframework.messaging.Message<?> receive​(org.springframework.messaging.MessageChannel destination, long timeout)  
    java.lang.Object receiveAndConvert​(org.springframework.messaging.MessageChannel destination, long timeout)  
    org.springframework.messaging.Message<?> sendAndReceive​(org.springframework.messaging.MessageChannel destination, org.springframework.messaging.Message<?> requestMessage)  
    void setBeanFactory​(org.springframework.beans.factory.BeanFactory beanFactory)
    Overridden to set the destination resolver to a integrationChannelResolver bean.
    void setDefaultChannel​(org.springframework.messaging.MessageChannel channel)
    Invokes setDefaultDestination(MessageChannel) - provided for backward compatibility.
    void setThrowExceptionOnLateReply​(boolean throwExceptionOnLateReply)  

    Methods inherited from class org.springframework.messaging.core.GenericMessagingTemplate

    doReceive, doReceive, doSend, doSend, doSendAndReceive, getReceiveTimeout, getReceiveTimeoutHeader, getSendTimeout, getSendTimeoutHeader, setReceiveTimeout, setReceiveTimeoutHeader, setSendTimeout, setSendTimeoutHeader

    Methods inherited from class org.springframework.messaging.core.AbstractDestinationResolvingMessagingTemplate

    convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, getDestinationResolver, receive, receiveAndConvert, resolveDestination, send, sendAndReceive, setDestinationResolver

    Methods inherited from class org.springframework.messaging.core.AbstractMessagingTemplate

    convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, sendAndReceive

    Methods inherited from class org.springframework.messaging.core.AbstractMessageReceivingTemplate

    doConvert, receive, receive, receiveAndConvert, receiveAndConvert

    Methods inherited from class org.springframework.messaging.core.AbstractMessageSendingTemplate

    convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, doConvert, getDefaultDestination, getMessageConverter, getRequiredDefaultDestination, processHeadersToSend, send, send, setDefaultDestination, setMessageConverter

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.messaging.core.MessageReceivingOperations

    receive, receive, receiveAndConvert, receiveAndConvert

    Methods inherited from interface org.springframework.messaging.core.MessageRequestReplyOperations

    convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, sendAndReceive

    Methods inherited from interface org.springframework.messaging.core.MessageSendingOperations

    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 invoking setDefaultChannel(MessageChannel).
    • MessagingTemplate

      public MessagingTemplate​(org.springframework.messaging.MessageChannel defaultChannel)
      Create a MessagingTemplate with the given default channel.
      Parameters:
      defaultChannel - the default MessageChannel for send operations
  • Method Details

    • setBeanFactory

      public void setBeanFactory​(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
      Overridden to set the destination resolver to a integrationChannelResolver bean.
      Specified by:
      setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
      Overrides:
      setBeanFactory in class org.springframework.messaging.core.GenericMessagingTemplate
      Throws:
      org.springframework.beans.BeansException
    • setThrowExceptionOnLateReply

      public void setThrowExceptionOnLateReply​(boolean throwExceptionOnLateReply)
      Overrides:
      setThrowExceptionOnLateReply in class org.springframework.messaging.core.GenericMessagingTemplate
    • setDefaultChannel

      public void setDefaultChannel​(org.springframework.messaging.MessageChannel channel)
      Invokes setDefaultDestination(MessageChannel) - provided for backward compatibility.
      Parameters:
      channel - the channel to set.
    • sendAndReceive

      public org.springframework.messaging.Message<?> sendAndReceive​(org.springframework.messaging.MessageChannel destination, org.springframework.messaging.Message<?> requestMessage)
      Specified by:
      sendAndReceive in interface org.springframework.messaging.core.MessageRequestReplyOperations<org.springframework.messaging.MessageChannel>
      Overrides:
      sendAndReceive in class org.springframework.messaging.core.AbstractMessagingTemplate<org.springframework.messaging.MessageChannel>
    • receiveAndConvert

      public java.lang.Object receiveAndConvert​(org.springframework.messaging.MessageChannel destination, long timeout)
    • receive

      public org.springframework.messaging.Message<?> receive​(org.springframework.messaging.MessageChannel destination, long timeout)