Class MultiRabbitListenerAnnotationBeanPostProcessor

java.lang.Object
org.springframework.amqp.rabbit.annotation.RabbitListenerAnnotationBeanPostProcessor
org.springframework.amqp.rabbit.annotation.MultiRabbitListenerAnnotationBeanPostProcessor
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.beans.factory.SmartInitializingSingleton, org.springframework.context.EnvironmentAware, org.springframework.core.Ordered

public class MultiRabbitListenerAnnotationBeanPostProcessor extends RabbitListenerAnnotationBeanPostProcessor
An extension of RabbitListenerAnnotationBeanPostProcessor that indicates the proper RabbitAdmin bean to be used when processing to the listeners, and also associates it to the declarables (Exchanges, Queues, and Bindings) returned.

This processing restricts the RabbitAdmin according to the related configuration, preventing the server from automatic binding non-related structures.

Since:
2.3
  • Constructor Details

    • MultiRabbitListenerAnnotationBeanPostProcessor

      public MultiRabbitListenerAnnotationBeanPostProcessor()
  • Method Details

    • processAmqpListener

      protected Collection<org.springframework.amqp.core.Declarable> processAmqpListener(RabbitListener rabbitListener, Method method, Object bean, String beanName)
      Overrides:
      processAmqpListener in class RabbitListenerAnnotationBeanPostProcessor
    • resolveMultiRabbitAdminName

      protected String resolveMultiRabbitAdminName(RabbitListener rabbitListener)
      Resolves the name of the RabbitAdmin bean based on the RabbitListener, or falls back to the default RabbitAdmin name provided by MultiRabbit.
      Parameters:
      rabbitListener - The RabbitListener to process the name from.
      Returns:
      The name of the RabbitAdmin bean.