Class StreamListenerContainer

java.lang.Object
org.springframework.rabbit.stream.listener.StreamListenerContainer
All Implemented Interfaces:
org.springframework.amqp.rabbit.listener.MessageListenerContainer, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle

public class StreamListenerContainer extends Object implements org.springframework.amqp.rabbit.listener.MessageListenerContainer, org.springframework.beans.factory.BeanNameAware
A listener container for RabbitMQ Streams.
Since:
2.4
  • Field Details

    • logger

      protected org.apache.commons.logging.Log logger
  • Constructor Details

    • StreamListenerContainer

      public StreamListenerContainer(com.rabbitmq.stream.Environment environment)
      Construct an instance using the provided environment.
      Parameters:
      environment - the environment.
    • StreamListenerContainer

      public StreamListenerContainer(com.rabbitmq.stream.Environment environment, @Nullable com.rabbitmq.stream.Codec codec)
      Construct an instance using the provided environment and codec.
      Parameters:
      environment - the environment.
      codec - the codec used to create reply messages.
  • Method Details

    • setQueueNames

      public void setQueueNames(String... queueNames)
      Specified by:
      setQueueNames in interface org.springframework.amqp.rabbit.listener.MessageListenerContainer
    • getStreamConverter

      public StreamMessageConverter getStreamConverter()
      Get a StreamMessageConverter used to convert a Message to a Message.
      Returns:
      the converter.
    • setStreamConverter

      public void setStreamConverter(StreamMessageConverter messageConverter)
      Set a StreamMessageConverter used to convert a Message to a Message.
      Parameters:
      messageConverter - the converter.
    • setConsumerCustomizer

      public void setConsumerCustomizer(ConsumerCustomizer consumerCustomizer)
      Customize the consumer builder before it is built.
      Parameters:
      consumerCustomizer - the customizer.
    • getListenerId

      @Nullable public String getListenerId()
      The 'id' attribute of the listener.
      Returns:
      the id (or the container bean name if no id set).
    • setListenerId

      public void setListenerId(String listenerId)
      Specified by:
      setListenerId in interface org.springframework.amqp.rabbit.listener.MessageListenerContainer
    • getBeanName

      @Nullable public String getBeanName()
      Return the bean name.
      Returns:
      the bean name.
    • setBeanName

      public void setBeanName(String beanName)
      Specified by:
      setBeanName in interface org.springframework.beans.factory.BeanNameAware
    • setAutoStartup

      public void setAutoStartup(boolean autoStart)
      Specified by:
      setAutoStartup in interface org.springframework.amqp.rabbit.listener.MessageListenerContainer
    • isAutoStartup

      public boolean isAutoStartup()
      Specified by:
      isAutoStartup in interface org.springframework.context.SmartLifecycle
    • setAdviceChain

      public void setAdviceChain(org.aopalliance.aop.Advice... advices)
      Set an advice chain to apply to the listener.
      Parameters:
      advices - the advice chain.
      Since:
      2.4.5
    • getMessageListener

      @Nullable public Object getMessageListener()
      Specified by:
      getMessageListener in interface org.springframework.amqp.rabbit.listener.MessageListenerContainer
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface org.springframework.context.Lifecycle
    • start

      public void start()
      Specified by:
      start in interface org.springframework.context.Lifecycle
    • stop

      public void stop()
      Specified by:
      stop in interface org.springframework.context.Lifecycle
    • setupMessageListener

      public void setupMessageListener(org.springframework.amqp.core.MessageListener messageListener)
      Specified by:
      setupMessageListener in interface org.springframework.amqp.rabbit.listener.MessageListenerContainer