Class AmqpClientInboundGateway

All Implemented Interfaces:
Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, Lifecycle, Phased, SmartLifecycle, ComponentSourceAware, ExpressionCapable, Pausable, IntegrationPattern, NamedComponent, IntegrationInboundManagement, IntegrationManagement, ManageableLifecycle, ManageableSmartLifecycle, TrackableComponent

public class AmqpClientInboundGateway extends MessagingGatewaySupport implements Pausable
A MessagingGatewaySupport implementation for AMQP 1.0 client.

Based on the RabbitAmqpListenerContainer and requires an AmqpConnectionFactory. An internal RabbitAmqpTemplate is used to send replies.

Since:
7.0
Author:
Artem Bilan
See Also:
  • RabbitAmqpListenerContainer
  • RabbitAmqpTemplate
  • RabbitAmqpMessageListenerAdapter
  • Constructor Details

    • AmqpClientInboundGateway

      public AmqpClientInboundGateway(org.springframework.amqp.rabbitmq.client.AmqpConnectionFactory connectionFactory, String... queueNames)
  • Method Details

    • setInitialCredits

      public void setInitialCredits(int initialCredits)
    • setPriority

      public void setPriority(int priority)
    • setStateListeners

      public void setStateListeners(com.rabbitmq.client.amqp.Resource.StateListener... stateListeners)
    • setAfterReceivePostProcessors

      public void setAfterReceivePostProcessors(MessagePostProcessor... afterReceivePostProcessors)
    • setAdviceChain

      public void setAdviceChain(Advice... advices)
    • setAutoSettle

      public void setAutoSettle(boolean autoSettle)
    • setDefaultRequeue

      public void setDefaultRequeue(boolean defaultRequeue)
    • setGracefulShutdownPeriod

      public void setGracefulShutdownPeriod(Duration gracefulShutdownPeriod)
    • setConsumersPerQueue

      public void setConsumersPerQueue(int consumersPerQueue)
    • setMessageConverter

      public void setMessageConverter(@Nullable MessageConverter messageConverter)
      Set a MessageConverter to replace the default SimpleMessageConverter. If set to null, an AMQP message is sent as is into a Message payload. And a reply message has to return an AMQP message as its payload.
      Parameters:
      messageConverter - the MessageConverter to use or null.
    • setHeaderMapper

      public void setHeaderMapper(AmqpHeaderMapper headerMapper)
    • setReplyPostProcessor

      public void setReplyPostProcessor(ReplyPostProcessor replyPostProcessor)
    • setReplyExchange

      public void setReplyExchange(String exchange)
      Set a default exchange for sending replies if replyTo address is not provided in the request message. Mutually exclusive with setReplyQueue(String).
      Parameters:
      exchange - the default exchange for sending replies
    • setReplyRoutingKey

      public void setReplyRoutingKey(String routingKey)
      Set a default routingKey for sending replies if replyTo address is not provided in the request message. Used only if setReplyExchange(String) is provided.
      Parameters:
      routingKey - the default routing key for sending replies
    • setReplyQueue

      public void setReplyQueue(String queue)
      Set a default queue for sending replies if replyTo address is not provided in the request message. Mutually exclusive with setReplyExchange(String).
      Parameters:
      queue - the default queue for sending replies
    • getComponentType

      public String getComponentType()
      Specified by:
      getComponentType in interface NamedComponent
      Overrides:
      getComponentType in class MessagingGatewaySupport
    • onInit

      protected void onInit()
      Description copied from class: IntegrationObjectSupport
      Subclasses may implement this for initialization logic.
      Overrides:
      onInit in class MessagingGatewaySupport
    • doStart

      protected void doStart()
      Description copied from class: AbstractEndpoint
      Subclasses must implement this method with the start behavior. This method will be invoked while holding the AbstractEndpoint.lifecycleLock.
      Overrides:
      doStart in class MessagingGatewaySupport
    • doStop

      protected void doStop()
      Description copied from class: AbstractEndpoint
      Subclasses must implement this method with the stop behavior. This method will be invoked while holding the AbstractEndpoint.lifecycleLock.
      Overrides:
      doStop in class MessagingGatewaySupport
    • destroy

      public void destroy()
      Specified by:
      destroy in interface DisposableBean
      Specified by:
      destroy in interface IntegrationManagement
      Overrides:
      destroy in class MessagingGatewaySupport
    • pause

      public void pause()
      Description copied from interface: Pausable
      Pause the endpoint.
      Specified by:
      pause in interface Pausable
    • resume

      public void resume()
      Description copied from interface: Pausable
      Resume the endpoint if paused.
      Specified by:
      resume in interface Pausable
    • isPaused

      public boolean isPaused()
      Description copied from interface: Pausable
      Check if the endpoint is paused.
      Specified by:
      isPaused in interface Pausable
      Returns:
      true if paused.