Class AmqpClientMessageProducer

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

public class AmqpClientMessageProducer extends MessageProducerSupport implements Pausable
A MessageProducerSupport implementation for AMQP 1.0 client.

Based on the RabbitAmqpListenerContainer and requires an AmqpConnectionFactory.

Since:
7.0
Author:
Artem Bilan
See Also:
  • RabbitAmqpListenerContainer
  • RabbitAmqpMessageListenerAdapter
  • 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(MessagePostProcessor... afterReceivePostProcessors)
    • setBatchSize

      public void setBatchSize(int batchSize)
    • setBatchReceiveTimeout

      public void setBatchReceiveTimeout(long batchReceiveTimeout)
    • setTaskScheduler

      public void setTaskScheduler(TaskScheduler taskScheduler)
      Description copied from class: IntegrationObjectSupport
      Configure a TaskScheduler for those components which logic relies on the scheduled tasks. If not provided, falls back to the global taskScheduler bean in the application context, provided by the Spring Integration infrastructure.
      Overrides:
      setTaskScheduler in class IntegrationObjectSupport
      Parameters:
      taskScheduler - the TaskScheduler to use.
      See Also:
    • 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.
      Parameters:
      messageConverter - the MessageConverter to use or null.
    • setHeaderMapper

      public void setHeaderMapper(AmqpHeaderMapper headerMapper)
    • getComponentType

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

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

      protected void doStart()
      Description copied from class: MessageProducerSupport
      Take no action by default. Subclasses may override this if they need lifecycle-managed behavior. Protected by 'lifecycleLock'.
      Overrides:
      doStart in class MessageProducerSupport
    • doStop

      protected void doStop()
      Description copied from class: MessageProducerSupport
      Take no action by default. Subclasses may override this if they need lifecycle-managed behavior.
      Overrides:
      doStop in class MessageProducerSupport
    • destroy

      public void destroy()
      Specified by:
      destroy in interface DisposableBean
      Specified by:
      destroy in interface IntegrationManagement
      Overrides:
      destroy in class AbstractEndpoint
    • 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.