Class RabbitMQConsumerAdvice

  • All Implemented Interfaces:
    io.micronaut.context.processor.AnnotationProcessor<Queue,​io.micronaut.inject.ExecutableMethod<?,​?>>, io.micronaut.context.processor.ExecutableMethodProcessor<Queue>, java.lang.AutoCloseable

    @Singleton
    public class RabbitMQConsumerAdvice
    extends java.lang.Object
    implements io.micronaut.context.processor.ExecutableMethodProcessor<Queue>, java.lang.AutoCloseable
    An ExecutableMethodProcessor that will process all beans annotated with RabbitListener and create and subscribe the relevant methods as consumers to RabbitMQ queues.
    Since:
    1.1.0
    • Constructor Detail

      • RabbitMQConsumerAdvice

        public RabbitMQConsumerAdvice​(io.micronaut.context.BeanContext beanContext,
                                      RabbitBinderRegistry binderRegistry,
                                      RabbitListenerExceptionHandler exceptionHandler,
                                      RabbitMessageSerDesRegistry serDesRegistry,
                                      io.micronaut.core.convert.ConversionService<?> conversionService,
                                      java.util.List<ChannelPool> channelPools)
        Default constructor.
        Parameters:
        beanContext - The bean context
        binderRegistry - The registry to bind arguments to the method
        exceptionHandler - The exception handler to use if the consumer isn't a handler
        serDesRegistry - The serialization/deserialization registry
        conversionService - The service to convert consume argument values
        channelPools - The channel pools to retrieve channels
    • Method Detail

      • process

        public void process​(io.micronaut.inject.BeanDefinition<?> beanDefinition,
                            io.micronaut.inject.ExecutableMethod<?,​?> method)
        Specified by:
        process in interface io.micronaut.context.processor.AnnotationProcessor<Queue,​io.micronaut.inject.ExecutableMethod<?,​?>>
        Specified by:
        process in interface io.micronaut.context.processor.ExecutableMethodProcessor<Queue>
      • close

        @PreDestroy
        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.Exception