Class AbstractReplyProducingMessageHandler

All Implemented Interfaces:
org.reactivestreams.Subscriber<Message<?>>, Aware, BeanClassLoaderAware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, Ordered, ExpressionCapable, Orderable, MessageProducer, HeaderPropagationAware, IntegrationPattern, NamedComponent, IntegrationManagement, TrackableComponent, MessageHandler, reactor.core.CoreSubscriber<Message<?>>
Direct Known Subclasses:
AbstractAmqpOutboundEndpoint, AbstractHttpRequestExecutingMessageHandler, AbstractMessageSplitter, AbstractRemoteFileOutboundGateway, AbstractReplyProducingPostProcessingMessageHandler, AbstractWebServiceOutboundGateway, BarrierMessageHandler, BridgeHandler, ContentEnricher, DelayHandler, FileWritingMessageHandler, GatewayMessageHandler, GraphQlMessageHandler, JdbcOutboundGateway, JmsOutboundGateway, JpaOutboundGateway, KafkaProducerMessageHandler, MessageTransformingHandler, MongoDbOutboundGateway, OperationInvokingMessageHandler, RedisOutboundGateway, RedisQueueOutboundGateway, ReplyProducingMessageHandlerWrapper, RSocketOutboundGateway, ScatterGatherHandler, ServiceActivatingHandler, StoredProcOutboundGateway, TcpOutboundGateway

public abstract class AbstractReplyProducingMessageHandler extends AbstractMessageProducingHandler implements BeanClassLoaderAware
Base class for MessageHandlers that are capable of producing replies.
Mark Fisher, Iwein Fuld, Oleg Zhurakousky, Gary Russell, Artem Bilan, David Liu, Trung Pham
  • Constructor Details

    • AbstractReplyProducingMessageHandler

      public AbstractReplyProducingMessageHandler()
  • Method Details

    • setRequiresReply

      public void setRequiresReply(boolean requiresReply)
      Flag whether a reply is required. If true an incoming message MUST result in a reply message being sent. If false an incoming message MAY result in a reply message being sent. Default is false.
      requiresReply - true if a reply is required.
    • getRequiresReply

      protected boolean getRequiresReply()
    • setAdviceChain

      public void setAdviceChain(List<Advice> adviceChain)
      Configure a list of Advices to proxy a handleRequestMessage(Message) method.
      adviceChain - the list of Advices to use.
    • hasAdviceChain

      protected boolean hasAdviceChain()
    • setBeanClassLoader

      public void setBeanClassLoader(ClassLoader beanClassLoader)
      Specified by:
      setBeanClassLoader in interface BeanClassLoaderAware
    • getBeanClassLoader

      protected ClassLoader getBeanClassLoader()
    • getIntegrationPatternType

      public IntegrationPatternType getIntegrationPatternType()
      Description copied from interface: IntegrationPattern
      Return a pattern type this component implements.
      Specified by:
      getIntegrationPatternType in interface IntegrationPattern
      getIntegrationPatternType in class MessageHandlerSupport
      the IntegrationPatternType this component implements.
    • onInit

      protected final void onInit()
      Description copied from class: IntegrationObjectSupport
      Subclasses may implement this for initialization logic.
      onInit in class AbstractMessageProducingHandler
    • doInit

      protected void doInit()
    • handleMessageInternal

      protected final void handleMessageInternal(Message<?> message)
      Specified by:
      handleMessageInternal in class AbstractMessageHandler
    • doInvokeAdvisedRequestHandler

      @Nullable protected Object doInvokeAdvisedRequestHandler(Message<?> message)
    • handleRequestMessage

      @Nullable protected abstract Object handleRequestMessage(Message<?> requestMessage)
      Subclasses must implement this method to handle the request Message. The return value may be a Message, a MessageBuilder, or any plain Object. The base class will handle the final creation of a reply Message from any of those starting points. If the return value is null, the Message flow will end here.
      requestMessage - The request message.
      The result of handling the message, or null.