Class AmqpMessageSource

java.lang.Object
org.springframework.integration.util.AbstractExpressionEvaluator
org.springframework.integration.endpoint.AbstractMessageSource<Object>
org.springframework.integration.amqp.inbound.AmqpMessageSource
All Implemented Interfaces:
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.integration.core.MessageSource<Object>, org.springframework.integration.IntegrationPattern, org.springframework.integration.support.context.NamedComponent, org.springframework.integration.support.management.IntegrationInboundManagement, org.springframework.integration.support.management.IntegrationManagement

public class AmqpMessageSource extends org.springframework.integration.endpoint.AbstractMessageSource<Object>
A pollable MessageSource for RabbitMQ.
Since:
5.0.1
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static class 
     
    static class 
    Information for building an AmqpAckCallback.

    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.util.AbstractExpressionEvaluator

    EXPRESSION_PARSER, logger

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

    METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
  • Constructor Summary

    Constructors
    Constructor
    Description
    AmqpMessageSource(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory, String queue)
     
    AmqpMessageSource(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory, AmqpMessageSource.AmqpAckCallbackFactory ackCallbackFactory, String queue)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.springframework.integration.support.AbstractIntegrationMessageBuilder<Object>
     
    protected org.springframework.amqp.rabbit.batch.BatchingStrategy
     
     
     
    protected org.springframework.amqp.support.converter.MessageConverter
     
    protected org.springframework.amqp.rabbit.support.MessagePropertiesConverter
     
    protected boolean
     
    protected boolean
     
    void
    setBatchingStrategy(org.springframework.amqp.rabbit.batch.BatchingStrategy batchingStrategy)
    Set a batching strategy to use when de-batching messages.
    void
    Set a custom AmqpHeaderMapper to replace the default DefaultAmqpHeaderMapper.inboundMapper().
    void
    setMessageConverter(org.springframework.amqp.support.converter.MessageConverter messageConverter)
    Set a custom MessageConverter to replace the default SimpleMessageConverter.
    void
    setPropertiesConverter(org.springframework.amqp.rabbit.support.MessagePropertiesConverter propertiesConverter)
    Set a custom MessagePropertiesConverter to replace the default DefaultMessagePropertiesConverter.
    void
    setRawMessageHeader(boolean rawMessageHeader)
    Set to true to include the raw spring-amqp message as a header with key AmqpMessageHeaderErrorMessageStrategy.AMQP_RAW_MESSAGE, enabling callers to have access to the message to process errors.
    void
    setTransacted(boolean transacted)
    Set to true to use a transacted channel for the ack.

    Methods inherited from class org.springframework.integration.endpoint.AbstractMessageSource

    buildMessage, destroy, getBeanName, getComponentName, getManagedName, getManagedType, getOverrides, isLoggingEnabled, receive, registerMetricsCaptor, setBeanName, setHeaderExpressions, setLoggingEnabled, setManagedName, setManagedType

    Methods inherited from class org.springframework.integration.util.AbstractExpressionEvaluator

    afterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, onInit, setBeanFactory, setConversionService

    Methods inherited from class java.lang.Object

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

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

    getThisAs, registerObservationRegistry

    Methods inherited from interface org.springframework.integration.core.MessageSource

    getIntegrationPatternType
  • Constructor Details

    • AmqpMessageSource

      public AmqpMessageSource(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory, String queue)
    • AmqpMessageSource

      public AmqpMessageSource(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory, AmqpMessageSource.AmqpAckCallbackFactory ackCallbackFactory, String queue)
  • Method Details

    • isTransacted

      protected boolean isTransacted()
    • setTransacted

      public void setTransacted(boolean transacted)
      Set to true to use a transacted channel for the ack.
      Parameters:
      transacted - true for transacted.
    • getPropertiesConverter

      protected org.springframework.amqp.rabbit.support.MessagePropertiesConverter getPropertiesConverter()
    • setPropertiesConverter

      public void setPropertiesConverter(org.springframework.amqp.rabbit.support.MessagePropertiesConverter propertiesConverter)
      Set a custom MessagePropertiesConverter to replace the default DefaultMessagePropertiesConverter.
      Parameters:
      propertiesConverter - the converter.
    • getHeaderMapper

      protected AmqpHeaderMapper getHeaderMapper()
    • setHeaderMapper

      public void setHeaderMapper(AmqpHeaderMapper headerMapper)
      Set a custom AmqpHeaderMapper to replace the default DefaultAmqpHeaderMapper.inboundMapper().
      Parameters:
      headerMapper - the header mapper.
    • getMessageConverter

      protected org.springframework.amqp.support.converter.MessageConverter getMessageConverter()
    • setMessageConverter

      public void setMessageConverter(org.springframework.amqp.support.converter.MessageConverter messageConverter)
      Set a custom MessageConverter to replace the default SimpleMessageConverter.
      Parameters:
      messageConverter - the converter.
    • isRawMessageHeader

      protected boolean isRawMessageHeader()
    • setRawMessageHeader

      public void setRawMessageHeader(boolean rawMessageHeader)
      Set to true to include the raw spring-amqp message as a header with key AmqpMessageHeaderErrorMessageStrategy.AMQP_RAW_MESSAGE, enabling callers to have access to the message to process errors. The raw message is also added to the common header IntegrationMessageHeaderAccessor.SOURCE_DATA.
      Parameters:
      rawMessageHeader - true to include the headers.
    • getBatchingStrategy

      protected org.springframework.amqp.rabbit.batch.BatchingStrategy getBatchingStrategy()
    • setBatchingStrategy

      public void setBatchingStrategy(org.springframework.amqp.rabbit.batch.BatchingStrategy batchingStrategy)
      Set a batching strategy to use when de-batching messages. Default is SimpleBatchingStrategy.
      Parameters:
      batchingStrategy - the strategy.
      Since:
      5.2
    • getComponentType

      public String getComponentType()
    • doReceive

      protected org.springframework.integration.support.AbstractIntegrationMessageBuilder<Object> doReceive()
      Specified by:
      doReceive in class org.springframework.integration.endpoint.AbstractMessageSource<Object>