Class AmqpClientMessageProducer

java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.endpoint.MessageProducerSupport
org.springframework.integration.amqp.inbound.AmqpClientMessageProducer
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.beans.factory.SmartInitializingSingleton, 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.MessageProducer, 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 AmqpClientMessageProducer extends org.springframework.integration.endpoint.MessageProducerSupport implements org.springframework.integration.core.Pausable
A MessageProducerSupport implementation for AMQP 1.0 client.

Based on the RabbitAmqpListenerContainer and requires an AmqpConnectionFactory.

Since:
7.0
See Also:
  • RabbitAmqpListenerContainer
  • RabbitAmqpMessageListenerAdapter
  • 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.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
    AmqpClientMessageProducer(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
    setBatchReceiveTimeout(long batchReceiveTimeout)
     
    void
    setBatchSize(int batchSize)
     
    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
    setStateListeners(com.rabbitmq.client.amqp.Resource.StateListener... stateListeners)
     
    void
    setTaskScheduler(org.springframework.scheduling.TaskScheduler taskScheduler)
     

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

    afterSingletonsInstantiated, buildErrorMessage, getErrorChannel, getErrorMessageAttributes, getErrorMessageStrategy, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, getRequiredOutputChannel, isObserved, registerObservationRegistry, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setObservationConvention, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrack, subscribeToPublisher

    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, 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

    getManagedName, getManagedType, getOverrides, getThisAs, isLoggingEnabled, registerMetricsCaptor, setLoggingEnabled, setManagedName, setManagedType

    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

    • AmqpClientMessageProducer

      public AmqpClientMessageProducer(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)
    • setBatchSize

      public void setBatchSize(int batchSize)
    • setBatchReceiveTimeout

      public void setBatchReceiveTimeout(long batchReceiveTimeout)
    • setTaskScheduler

      public void setTaskScheduler(org.springframework.scheduling.TaskScheduler taskScheduler)
      Overrides:
      setTaskScheduler in class org.springframework.integration.context.IntegrationObjectSupport
    • 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.
      Parameters:
      messageConverter - the MessageConverter to use or null.
    • setHeaderMapper

      public void setHeaderMapper(AmqpHeaderMapper headerMapper)
    • getComponentType

      public String getComponentType()
      Specified by:
      getComponentType in interface org.springframework.integration.support.context.NamedComponent
      Overrides:
      getComponentType in class org.springframework.integration.endpoint.MessageProducerSupport
    • onInit

      protected void onInit()
      Overrides:
      onInit in class org.springframework.integration.endpoint.MessageProducerSupport
    • doStart

      protected void doStart()
      Overrides:
      doStart in class org.springframework.integration.endpoint.MessageProducerSupport
    • doStop

      protected void doStop()
      Overrides:
      doStop in class org.springframework.integration.endpoint.MessageProducerSupport
    • 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.endpoint.AbstractEndpoint
    • 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