Class RabbitMQConsumerAdvice

java.lang.Object
io.micronaut.rabbitmq.intercept.RabbitMQConsumerAdvice
All Implemented Interfaces:
io.micronaut.context.processor.ExecutableMethodProcessor<Queue>, AutoCloseable

@Singleton public class RabbitMQConsumerAdvice extends Object implements io.micronaut.context.processor.ExecutableMethodProcessor<Queue>, 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
Author:
James Kleeh
  • Constructor Details

    • RabbitMQConsumerAdvice

      public RabbitMQConsumerAdvice(io.micronaut.context.BeanContext beanContext, io.micronaut.context.event.ApplicationEventPublisher<RabbitConsumerStarting> startingPublisher, io.micronaut.context.event.ApplicationEventPublisher<RabbitConsumerStarted> startedPublisher, RabbitBinderRegistry binderRegistry, RabbitListenerExceptionHandler exceptionHandler, RabbitMessageSerDesRegistry serDesRegistry, io.micronaut.core.convert.ConversionService conversionService, List<ChannelPool> channelPools)
      Default constructor.
      Parameters:
      beanContext - The bean context
      startingPublisher - The RabbitConsumerStarting event publisher
      startedPublisher - The RabbitConsumerStarted event publisher
      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
      Since:
      4.1.0
  • Method Details

    • process

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

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