@Singleton public class RabbitMQConsumerAdvice extends java.lang.Object implements io.micronaut.context.processor.ExecutableMethodProcessor<RabbitListener>, java.lang.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,
RabbitBinderRegistry binderRegistry,
RabbitListenerExceptionHandler exceptionHandler,
RabbitMessageSerDesRegistry serDesRegistry,
io.micronaut.core.convert.ConversionService conversionService)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected com.rabbitmq.client.Channel |
getChannel(ChannelPool channelPool)
Retrieves a channel to use for consuming messages.
|
void |
process(io.micronaut.inject.BeanDefinition<?> beanDefinition,
io.micronaut.inject.ExecutableMethod<?,?> method) |
public RabbitMQConsumerAdvice(io.micronaut.context.BeanContext beanContext, RabbitBinderRegistry binderRegistry, RabbitListenerExceptionHandler exceptionHandler, RabbitMessageSerDesRegistry serDesRegistry, io.micronaut.core.convert.ConversionService conversionService)
beanContext
- The bean contextbinderRegistry
- 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 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 java.lang.Exception
close
in interface java.lang.AutoCloseable
java.lang.Exception
protected com.rabbitmq.client.Channel getChannel(ChannelPool channelPool)
channelPool
- The channel pool to retrieve the channel from