Class 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 java.lang.Object
    implements org.springframework.amqp.rabbit.listener.MessageListenerContainer, org.springframework.beans.factory.BeanNameAware
    A listener container for RabbitMQ Streams.
    Since:
    2.4
    • Field Detail

      • logger

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

      • 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 Detail

      • setQueueNames

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

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

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

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

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

        public void setBeanName​(java.lang.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
      • getMessageListener

        @Nullable
        public java.lang.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