Class AbstractRabbitListenerEndpoint

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract org.springframework.amqp.core.MessageListener createMessageListener​(MessageListenerContainer container)
      Create a MessageListener that is able to serve this endpoint for the specified container.
      org.springframework.amqp.core.AcknowledgeMode getAckMode()
      Override the container factory's AcknowledgeMode.
      org.springframework.amqp.core.AmqpAdmin getAdmin()  
      java.lang.Boolean getAutoStartup()
      Override of the default autoStartup property.
      BatchingStrategy getBatchingStrategy()  
      protected org.springframework.beans.factory.config.BeanExpressionContext getBeanExpressionContext()  
      protected org.springframework.beans.factory.BeanFactory getBeanFactory()  
      protected org.springframework.expression.BeanResolver getBeanResolver()  
      java.lang.String getConcurrency()
      The concurrency of this endpoint; Not used by this abstract class; used by subclasses to set the concurrency appropriate for the container type.
      protected java.lang.StringBuilder getEndpointDescription()  
      java.lang.String getGroup()  
      java.lang.String getId()  
      org.springframework.amqp.support.converter.MessageConverter getMessageConverter()
      Used by the container factory to check if this endpoint supports the preferred way for a container factory to pass a message converter to the endpoint's adapter.
      java.lang.Integer getPriority()  
      java.util.Collection<java.lang.String> getQueueNames()  
      java.util.Collection<org.springframework.amqp.core.Queue> getQueues()  
      java.lang.String getReplyContentType()
      Get the reply content type.
      ReplyPostProcessor getReplyPostProcessor()
      Return a ReplyPostProcessor to post process a reply message before it is sent.
      protected org.springframework.beans.factory.config.BeanExpressionResolver getResolver()  
      org.springframework.core.task.TaskExecutor getTaskExecutor()
      Get the task executor to use for this endpoint's listener container.
      boolean isBatchListener()  
      boolean isConverterWinsContentType()
      Return whether the content type set by a converter prevails or not.
      boolean isExclusive()  
      void setAckMode​(org.springframework.amqp.core.AcknowledgeMode mode)  
      void setAdmin​(org.springframework.amqp.core.AmqpAdmin admin)
      Set the AmqpAdmin instance to use.
      void setAutoStartup​(java.lang.Boolean autoStartup)
      Override the default autoStartup property.
      void setBatchingStrategy​(BatchingStrategy batchingStrategy)
      Set a BatchingStrategy to use when debatching messages.
      void setBatchListener​(boolean batchListener)
      Set to true if this endpoint should create a batch listener.
      void setBeanFactory​(org.springframework.beans.factory.BeanFactory beanFactory)  
      void setConcurrency​(java.lang.String concurrency)
      Set the concurrency of this endpoint; usually overrides any concurrency settings on the container factory.
      void setConverterWinsContentType​(boolean converterWinsContentType)
      Set whether the content type set by a converter prevails or not.
      void setExclusive​(boolean exclusive)
      Set if a single consumer in the container will have exclusive use of the queues, preventing other consumers from receiving messages from the queue(s).
      void setGroup​(java.lang.String group)
      Set the group for the corresponding listener container.
      void setId​(java.lang.String id)  
      void setMessageConverter​(org.springframework.amqp.support.converter.MessageConverter messageConverter)
      The preferred way for a container factory to pass a message converter to the endpoint's adapter.
      void setPriority​(java.lang.Integer priority)
      Set the priority of this endpoint.
      void setQueueNames​(java.lang.String... queueNames)
      Set the queue names to use.
      void setQueues​(org.springframework.amqp.core.Queue... queues)
      Set the queues to use.
      void setReplyContentType​(java.lang.String replyContentType)
      Set the reply content type.
      void setReplyPostProcessor​(ReplyPostProcessor replyPostProcessor)
      Set a ReplyPostProcessor to post process a response message before it is sent.
      void setTaskExecutor​(org.springframework.core.task.TaskExecutor taskExecutor)
      Override the default task executor.
      void setupListenerContainer​(MessageListenerContainer listenerContainer)
      Setup the specified message listener container with the model defined by this endpoint.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AbstractRabbitListenerEndpoint

        public AbstractRabbitListenerEndpoint()
    • Method Detail

      • setBeanFactory

        public void setBeanFactory​(org.springframework.beans.factory.BeanFactory beanFactory)
                            throws org.springframework.beans.BeansException
        Specified by:
        setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
        Throws:
        org.springframework.beans.BeansException
      • getBeanFactory

        @Nullable
        protected org.springframework.beans.factory.BeanFactory getBeanFactory()
      • getResolver

        protected org.springframework.beans.factory.config.BeanExpressionResolver getResolver()
      • getBeanResolver

        protected org.springframework.expression.BeanResolver getBeanResolver()
      • getBeanExpressionContext

        protected org.springframework.beans.factory.config.BeanExpressionContext getBeanExpressionContext()
      • setId

        public void setId​(java.lang.String id)
      • setQueues

        public void setQueues​(org.springframework.amqp.core.Queue... queues)
        Set the queues to use. Either the Queue instances or the queue names should be provided, but not both.
        Parameters:
        queues - to set.
        See Also:
        setQueueNames(java.lang.String...)
      • getQueues

        public java.util.Collection<org.springframework.amqp.core.Queue> getQueues()
        Returns:
        the queues for this endpoint.
      • getQueueNames

        public java.util.Collection<java.lang.String> getQueueNames()
        Returns:
        the queue names for this endpoint.
      • setQueueNames

        public void setQueueNames​(java.lang.String... queueNames)
        Set the queue names to use. Either the Queue instances or the queue names should be provided, but not both.
        Parameters:
        queueNames - to set.
        See Also:
        setQueues(org.springframework.amqp.core.Queue...)
      • setExclusive

        public void setExclusive​(boolean exclusive)
        Set if a single consumer in the container will have exclusive use of the queues, preventing other consumers from receiving messages from the queue(s).
        Parameters:
        exclusive - the exclusive boolean flag.
      • isExclusive

        public boolean isExclusive()
        Returns:
        the exclusive boolean flag.
      • setPriority

        public void setPriority​(java.lang.Integer priority)
        Set the priority of this endpoint.
        Parameters:
        priority - the priority value.
      • getPriority

        public java.lang.Integer getPriority()
        Returns:
        the priority of this endpoint or null if no priority is set.
      • setConcurrency

        public void setConcurrency​(java.lang.String concurrency)
        Set the concurrency of this endpoint; usually overrides any concurrency settings on the container factory. Contents depend on container implementation.
        Parameters:
        concurrency - the concurrency.
        Since:
        2.0
      • getConcurrency

        public java.lang.String getConcurrency()
        The concurrency of this endpoint; Not used by this abstract class; used by subclasses to set the concurrency appropriate for the container type.
        Specified by:
        getConcurrency in interface RabbitListenerEndpoint
        Returns:
        the concurrency.
        Since:
        2.0
      • setAdmin

        public void setAdmin​(org.springframework.amqp.core.AmqpAdmin admin)
        Set the AmqpAdmin instance to use.
        Parameters:
        admin - the AmqpAdmin instance.
      • getAdmin

        public org.springframework.amqp.core.AmqpAdmin getAdmin()
        Returns:
        the AmqpAdmin instance to use or null if none is configured.
      • getGroup

        public java.lang.String getGroup()
        Specified by:
        getGroup in interface RabbitListenerEndpoint
        Returns:
        the group of this endpoint or null if not in a group.
      • setGroup

        public void setGroup​(java.lang.String group)
        Set the group for the corresponding listener container.
        Parameters:
        group - the group.
        Since:
        1.5
      • setAutoStartup

        public void setAutoStartup​(java.lang.Boolean autoStartup)
        Override the default autoStartup property.
        Parameters:
        autoStartup - the autoStartup.
        Since:
        2.0
      • getMessageConverter

        public org.springframework.amqp.support.converter.MessageConverter getMessageConverter()
        Description copied from interface: RabbitListenerEndpoint
        Used by the container factory to check if this endpoint supports the preferred way for a container factory to pass a message converter to the endpoint's adapter. If null is returned, the factory will fall back to the legacy method of passing the converter via the container.
        Specified by:
        getMessageConverter in interface RabbitListenerEndpoint
        Returns:
        the converter.
      • setMessageConverter

        public void setMessageConverter​(org.springframework.amqp.support.converter.MessageConverter messageConverter)
        Description copied from interface: RabbitListenerEndpoint
        The preferred way for a container factory to pass a message converter to the endpoint's adapter.
        Specified by:
        setMessageConverter in interface RabbitListenerEndpoint
        Parameters:
        messageConverter - the converter.
      • getTaskExecutor

        public org.springframework.core.task.TaskExecutor getTaskExecutor()
        Description copied from interface: RabbitListenerEndpoint
        Get the task executor to use for this endpoint's listener container. Overrides any executor set on the container factory.
        Specified by:
        getTaskExecutor in interface RabbitListenerEndpoint
        Returns:
        the executor.
      • setTaskExecutor

        public void setTaskExecutor​(org.springframework.core.task.TaskExecutor taskExecutor)
        Override the default task executor.
        Parameters:
        taskExecutor - the executor.
        Since:
        2.2
      • isBatchListener

        public boolean isBatchListener()
      • getAckMode

        @Nullable
        public org.springframework.amqp.core.AcknowledgeMode getAckMode()
        Description copied from interface: RabbitListenerEndpoint
        Override the container factory's AcknowledgeMode.
        Specified by:
        getAckMode in interface RabbitListenerEndpoint
        Returns:
        the acknowledgment mode.
      • setAckMode

        public void setAckMode​(org.springframework.amqp.core.AcknowledgeMode mode)
      • setReplyPostProcessor

        public void setReplyPostProcessor​(ReplyPostProcessor replyPostProcessor)
        Set a ReplyPostProcessor to post process a response message before it is sent.
        Parameters:
        replyPostProcessor - the post processor.
        Since:
        2.2.5
      • setReplyContentType

        public void setReplyContentType​(java.lang.String replyContentType)
        Set the reply content type.
        Parameters:
        replyContentType - the content type.
        Since:
        2.3
      • setConverterWinsContentType

        public void setConverterWinsContentType​(boolean converterWinsContentType)
        Set whether the content type set by a converter prevails or not.
        Parameters:
        converterWinsContentType - false to always apply the reply content type.
        Since:
        2.3
      • setupListenerContainer

        public void setupListenerContainer​(MessageListenerContainer listenerContainer)
        Description copied from interface: RabbitListenerEndpoint
        Setup the specified message listener container with the model defined by this endpoint.

        This endpoint must provide the requested missing option(s) of the specified container to make it usable. Usually, this is about setting the queues and the messageListener to use but an implementation may override any default setting that was already set.

        Specified by:
        setupListenerContainer in interface RabbitListenerEndpoint
        Parameters:
        listenerContainer - the listener container to configure
      • createMessageListener

        protected abstract org.springframework.amqp.core.MessageListener createMessageListener​(MessageListenerContainer container)
        Create a MessageListener that is able to serve this endpoint for the specified container.
        Parameters:
        container - the MessageListenerContainer to create a MessageListener.
        Returns:
        a a MessageListener instance.
      • getEndpointDescription

        protected java.lang.StringBuilder getEndpointDescription()
        Returns:
        a description for this endpoint.

        Available to subclasses, for inclusion in their toString() result.

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object