Package io.micronaut.rabbitmq.intercept
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 Summary
ConstructorsConstructorDescriptionRabbitMQConsumerAdvice(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. -
Method Summary
-
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 contextstartingPublisher- The RabbitConsumerStarting event publisherstartedPublisher- The RabbitConsumerStarted event publisherbinderRegistry- The registry to bind arguments to the methodexceptionHandler- The exception handler to use if the consumer isn't a handlerserDesRegistry- The serialization/deserialization registryconversionService- The service to convert consume argument valueschannelPools- 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:
processin interfaceio.micronaut.context.processor.ExecutableMethodProcessor<Queue>
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-