Class AmqpClientInboundGateway

java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.gateway.MessagingGatewaySupport
org.springframework.integration.amqp.inbound.AmqpClientInboundGateway
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.context.ApplicationContextAware, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, org.springframework.integration.context.ComponentSourceAware, org.springframework.integration.context.ExpressionCapable, org.springframework.integration.core.Pausable, org.springframework.integration.IntegrationPattern, org.springframework.integration.support.context.NamedComponent, org.springframework.integration.support.management.IntegrationInboundManagement, org.springframework.integration.support.management.IntegrationManagement, org.springframework.integration.support.management.ManageableLifecycle, org.springframework.integration.support.management.ManageableSmartLifecycle, org.springframework.integration.support.management.TrackableComponent

public class AmqpClientInboundGateway extends org.springframework.integration.gateway.MessagingGatewaySupport implements org.springframework.integration.core.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
See Also:
  • RabbitAmqpListenerContainer
  • RabbitAmqpTemplate
  • RabbitAmqpMessageListenerAdapter
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.springframework.integration.gateway.MessagingGatewaySupport

    org.springframework.integration.gateway.MessagingGatewaySupport.ConvertingMessagingTemplate

    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.gateway.MessagingGatewaySupport

    messagingTemplate

    Fields inherited from class org.springframework.integration.endpoint.AbstractEndpoint

    lifecycleLock

    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.context.SmartLifecycle

    DEFAULT_PHASE
  • Constructor Summary

    Constructors
    Constructor
    Description
    AmqpClientInboundGateway(org.springframework.amqp.rabbitmq.client.AmqpConnectionFactory connectionFactory, String... queueNames)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected void
     
    protected void
     
     
    boolean
     
    protected void
     
    void
     
    void
     
    void
    setAdviceChain(org.aopalliance.aop.Advice... advices)
     
    void
    setAfterReceivePostProcessors(org.springframework.amqp.core.MessagePostProcessor... afterReceivePostProcessors)
     
    void
    setAutoSettle(boolean autoSettle)
     
    void
    setConsumersPerQueue(int consumersPerQueue)
     
    void
    setDefaultRequeue(boolean defaultRequeue)
     
    void
    setGracefulShutdownPeriod(Duration gracefulShutdownPeriod)
     
    void
     
    void
    setInitialCredits(int initialCredits)
     
    void
    setMessageConverter(@Nullable org.springframework.amqp.support.converter.MessageConverter messageConverter)
    Set a MessageConverter to replace the default SimpleMessageConverter.
    void
    setPriority(int priority)
     
    void
    Set a default exchange for sending replies if replyTo address is not provided in the request message.
    void
    setReplyPostProcessor(org.springframework.amqp.rabbit.listener.adapter.ReplyPostProcessor replyPostProcessor)
     
    void
    Set a default queue for sending replies if replyTo address is not provided in the request message.
    void
    Set a default routingKey for sending replies if replyTo address is not provided in the request message.
    void
    setStateListeners(com.rabbitmq.client.amqp.Resource.StateListener... stateListeners)
     

    Methods inherited from class org.springframework.integration.gateway.MessagingGatewaySupport

    buildErrorMessage, buildSendTimer, getErrorChannel, getErrorMessageAttributes, getErrorMessageStrategy, getIntegrationPatternType, getManagedName, getManagedType, getOverrides, getReplyChannel, getRequestChannel, isLoggingEnabled, isObserved, receive, receive, receiveMessage, receiveMessage, registerMetricsCaptor, registerObservationRegistry, registerReplyMessageCorrelatorIfNecessary, send, sendAndReceive, sendAndReceiveMessage, sendAndReceiveMessageReactive, sendTimer, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setErrorOnTimeout, setLoggingEnabled, setManagedName, setManagedType, setObservationConvention, setReceiverObservationConvention, setReplyChannel, setReplyChannelName, setReplyMapper, setReplyTimeout, setRequestChannel, setRequestChannelName, setRequestMapper, setRequestTimeout, setShouldTrack

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

    doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stop

    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 Object

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

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

    getThisAs

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

    isRunning, start, stop

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

    getBeanName, getComponentName

    Methods inherited from interface org.springframework.context.SmartLifecycle

    isPauseable
  • 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(org.springframework.amqp.core.MessagePostProcessor... afterReceivePostProcessors)
    • setAdviceChain

      public void setAdviceChain(org.aopalliance.aop.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 org.springframework.amqp.support.converter.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(org.springframework.amqp.rabbit.listener.adapter.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 org.springframework.integration.support.context.NamedComponent
      Overrides:
      getComponentType in class org.springframework.integration.gateway.MessagingGatewaySupport
    • onInit

      protected void onInit()
      Overrides:
      onInit in class org.springframework.integration.gateway.MessagingGatewaySupport
    • doStart

      protected void doStart()
      Overrides:
      doStart in class org.springframework.integration.gateway.MessagingGatewaySupport
    • doStop

      protected void doStop()
      Overrides:
      doStop in class org.springframework.integration.gateway.MessagingGatewaySupport
    • destroy

      public void destroy()
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean
      Specified by:
      destroy in interface org.springframework.integration.support.management.IntegrationManagement
      Overrides:
      destroy in class org.springframework.integration.gateway.MessagingGatewaySupport
    • pause

      public void pause()
      Specified by:
      pause in interface org.springframework.integration.core.Pausable
    • resume

      public void resume()
      Specified by:
      resume in interface org.springframework.integration.core.Pausable
    • isPaused

      public boolean isPaused()
      Specified by:
      isPaused in interface org.springframework.integration.core.Pausable