@Singleton public class RabbitMQConsumerAdvice extends Object implements io.micronaut.context.processor.ExecutableMethodProcessor<RabbitListener>, AutoCloseable
ExecutableMethodProcessor
that will process all beans annotated
with RabbitListener
and create and subscribe the relevant methods
as consumers to RabbitMQ queues.Constructor and Description |
---|
RabbitMQConsumerAdvice(io.micronaut.context.BeanContext beanContext,
ChannelPool channelPool,
RabbitBinderRegistry binderRegistry,
RabbitListenerExceptionHandler exceptionHandler,
io.micronaut.core.convert.ConversionService conversionService)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected com.rabbitmq.client.Channel |
getChannel() |
void |
process(io.micronaut.inject.BeanDefinition<?> beanDefinition,
io.micronaut.inject.ExecutableMethod<?,?> method) |
public RabbitMQConsumerAdvice(io.micronaut.context.BeanContext beanContext, ChannelPool channelPool, RabbitBinderRegistry binderRegistry, RabbitListenerExceptionHandler exceptionHandler, io.micronaut.core.convert.ConversionService conversionService)
beanContext
- The bean contextchannelPool
- The pool to retrieve channels frombinderRegistry
- The registry to bind arguments to the methodexceptionHandler
- The exception handler to use if the consumer isn't a handlerconversionService
- The service to convert consume argument valuespublic void process(io.micronaut.inject.BeanDefinition<?> beanDefinition, io.micronaut.inject.ExecutableMethod<?,?> method)
process
in interface io.micronaut.context.processor.AnnotationProcessor<RabbitListener,io.micronaut.inject.ExecutableMethod<?,?>>
process
in interface io.micronaut.context.processor.ExecutableMethodProcessor<RabbitListener>
@PreDestroy public void close() throws Exception
close
in interface AutoCloseable
Exception
protected com.rabbitmq.client.Channel getChannel()