Class RabbitStreamMessageHandler

java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.amqp.outbound.RabbitStreamMessageHandler
All Implemented Interfaces:
org.reactivestreams.Subscriber<org.springframework.messaging.Message<?>>, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.core.Ordered, org.springframework.integration.context.ExpressionCapable, org.springframework.integration.context.Orderable, org.springframework.integration.IntegrationPattern, org.springframework.integration.support.context.NamedComponent, org.springframework.integration.support.management.IntegrationManagement, org.springframework.integration.support.management.TrackableComponent, org.springframework.messaging.MessageHandler, reactor.core.CoreSubscriber<org.springframework.messaging.Message<?>>

public class RabbitStreamMessageHandler extends org.springframework.integration.handler.AbstractMessageHandler
MessageHandler based on RabbitStreamOperations.
Since:
6.0
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement

    org.springframework.integration.support.management.IntegrationManagement.ManagementOverrides
  • Field Summary

    Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport

    EXPRESSION_PARSER, logger

    Fields inherited from interface org.springframework.integration.support.management.IntegrationManagement

    METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
    RabbitStreamMessageHandler(org.springframework.rabbit.stream.producer.RabbitStreamOperations streamOperations)
    Create an instance with the provided RabbitStreamOperations.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.springframework.messaging.MessageChannel
     
    protected org.springframework.messaging.MessageChannel
     
    org.springframework.rabbit.stream.producer.RabbitStreamOperations
    Return the RabbitStreamOperations.
    protected void
    handleMessageInternal(org.springframework.messaging.Message<?> requestMessage)
     
    void
    setConfirmTimeout(long confirmTimeout)
    Set the confirm timeout.
    void
    Set a custom AmqpHeaderMapper for mapping request and reply headers.
    void
    setHeadersMappedLast(boolean headersMappedLast)
    When mapping headers for the outbound message, determine whether the headers are mapped before the message is converted, or afterwards.
    void
    setSendFailureChannel(org.springframework.messaging.MessageChannel sendFailureChannel)
    Set the failure channel.
    void
    setSendFailureChannelName(String sendFailureChannelName)
    Set the failure channel name.
    void
    setSendSuccessChannel(org.springframework.messaging.MessageChannel sendSuccessChannel)
    Set the success channel.
    void
    setSendSuccessChannelName(String sendSuccessChannelName)
    Set the Success channel name.
    void
    setSync(boolean sync)
    Set to true to wait for a confirmation.

    Methods inherited from class org.springframework.integration.handler.AbstractMessageHandler

    handleMessage, onComplete, onError, onNext, onSubscribe, setObservationConvention

    Methods inherited from class org.springframework.integration.handler.MessageHandlerSupport

    buildSendTimer, destroy, getComponentType, getIntegrationPatternType, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrack

    Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport

    afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, onInit, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface reactor.core.CoreSubscriber

    currentContext

    Methods inherited from interface org.springframework.integration.support.management.IntegrationManagement

    getThisAs

    Methods inherited from interface org.springframework.integration.support.context.NamedComponent

    getBeanName, getComponentName
  • Constructor Details

    • RabbitStreamMessageHandler

      public RabbitStreamMessageHandler(org.springframework.rabbit.stream.producer.RabbitStreamOperations streamOperations)
      Create an instance with the provided RabbitStreamOperations.
      Parameters:
      streamOperations - the operations.
  • Method Details

    • setSendFailureChannel

      public void setSendFailureChannel(org.springframework.messaging.MessageChannel sendFailureChannel)
      Set the failure channel. After a send failure, an ErrorMessage will be sent to this channel with a payload of the exception with the failed message.
      Parameters:
      sendFailureChannel - the failure channel.
    • setSendFailureChannelName

      public void setSendFailureChannelName(String sendFailureChannelName)
      Set the failure channel name. After a send failure, an ErrorMessage will be sent to this channel with a payload of the exception with the failed message.
      Parameters:
      sendFailureChannelName - the failure channel name.
    • setSendSuccessChannel

      public void setSendSuccessChannel(org.springframework.messaging.MessageChannel sendSuccessChannel)
      Set the success channel.
      Parameters:
      sendSuccessChannel - the success channel.
    • setSendSuccessChannelName

      public void setSendSuccessChannelName(String sendSuccessChannelName)
      Set the Success channel name.
      Parameters:
      sendSuccessChannelName - the success channel name.
    • setSync

      public void setSync(boolean sync)
      Set to true to wait for a confirmation.
      Parameters:
      sync - true to wait.
      See Also:
    • setConfirmTimeout

      public void setConfirmTimeout(long confirmTimeout)
      Set the confirm timeout.
      Parameters:
      confirmTimeout - the timeout.
      See Also:
    • setHeaderMapper

      public void setHeaderMapper(AmqpHeaderMapper headerMapper)
      Set a custom AmqpHeaderMapper for mapping request and reply headers. Defaults to DefaultAmqpHeaderMapper.outboundMapper().
      Parameters:
      headerMapper - the AmqpHeaderMapper to use.
    • setHeadersMappedLast

      public void setHeadersMappedLast(boolean headersMappedLast)
      When mapping headers for the outbound message, determine whether the headers are mapped before the message is converted, or afterwards. This only affects headers that might be added by the message converter. When false, the converter's headers win; when true, any headers added by the converter will be overridden (if the source message has a header that maps to those headers). You might wish to set this to true, for example, when using a SimpleMessageConverter with a String payload that contains json; the converter will set the content type to text/plain which can be overridden to application/json by setting the AmqpHeaders.CONTENT_TYPE message header. Default: false.
      Parameters:
      headersMappedLast - true if headers are mapped after conversion.
    • getStreamOperations

      public org.springframework.rabbit.stream.producer.RabbitStreamOperations getStreamOperations()
      Return the RabbitStreamOperations.
      Returns:
      the operations.
    • getSendFailureChannel

      protected org.springframework.messaging.MessageChannel getSendFailureChannel()
    • getSendSuccessChannel

      protected org.springframework.messaging.MessageChannel getSendSuccessChannel()
    • handleMessageInternal

      protected void handleMessageInternal(org.springframework.messaging.Message<?> requestMessage)
      Specified by:
      handleMessageInternal in class org.springframework.integration.handler.AbstractMessageHandler