Class SqsMessageHandler

java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.handler.AbstractMessageProducingHandler
io.awspring.cloud.sqs.integration.SqsMessageHandler
All Implemented Interfaces:
org.reactivestreams.Subscriber<Message<?>>, Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, Ordered, org.springframework.integration.context.ComponentSourceAware, org.springframework.integration.context.ExpressionCapable, org.springframework.integration.context.Orderable, org.springframework.integration.core.MessageProducer, org.springframework.integration.handler.HeaderPropagationAware, org.springframework.integration.IntegrationPattern, org.springframework.integration.support.context.NamedComponent, org.springframework.integration.support.management.IntegrationManagement, org.springframework.integration.support.management.TrackableComponent, MessageHandler, reactor.core.CoreSubscriber<Message<?>>

public class SqsMessageHandler extends org.springframework.integration.handler.AbstractMessageProducingHandler
The AbstractMessageProducingHandler implementation for the Amazon SQS. All the logic based on the AsyncMessagingOperations.sendAsync(String, Message) or AsyncMessagingOperations.sendManyAsync(String, Collection) if the request message's payload is a collection of Message instances.

All the SQS-specific message attributes have to be provided in the respective message headers via SqsHeaders.MessageSystemAttributes constant values or with the SqsAsyncOperations.

This AbstractMessageProducingHandler produces a reply only in the AbstractMessageProducingHandler.isAsync() mode. For a single request message the SendResult is converted to the reply message with respective headers. The SendResult.Batch is sent as a reply message's payload as is.

Since:
4.0
Author:
Artem Bilan
See Also:
  • 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
    Modifier and Type
    Field
    Description
    static final long
     

    Fields inherited from class org.springframework.integration.handler.AbstractMessageProducingHandler

    messagingTemplate

    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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    protected void
     
    void
     
    void
    setQueueExpression(Expression queueExpression)
     
    void
     
    void
    setSendTimeout(long sendTimeout)
     
    void
    setSendTimeoutExpression(Expression sendTimeoutExpression)
     
    void
    setSendTimeoutExpressionString(String sendTimeoutExpression)
     
    protected boolean
     

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

    addNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setupMessageProcessor, shouldSplitOutput, updateNotPropagatedHeaders

    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, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, 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
  • Field Details

  • Constructor Details

  • Method Details

    • setQueue

      public void setQueue(String queue)
    • setQueueExpressionString

      public void setQueueExpressionString(String queueExpression)
    • setQueueExpression

      public void setQueueExpression(Expression queueExpression)
    • setSendTimeout

      public void setSendTimeout(long sendTimeout)
      Overrides:
      setSendTimeout in class org.springframework.integration.handler.AbstractMessageProducingHandler
    • setSendTimeoutExpressionString

      public void setSendTimeoutExpressionString(String sendTimeoutExpression)
    • setSendTimeoutExpression

      public void setSendTimeoutExpression(Expression sendTimeoutExpression)
    • onInit

      protected void onInit()
      Overrides:
      onInit in class org.springframework.integration.handler.AbstractMessageProducingHandler
    • shouldCopyRequestHeaders

      protected boolean shouldCopyRequestHeaders()
      Overrides:
      shouldCopyRequestHeaders in class org.springframework.integration.handler.AbstractMessageProducingHandler
    • handleMessageInternal

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