Class RabbitMetricsInterceptor

java.lang.Object
io.micronaut.rabbitmq.metrics.RabbitMetricsInterceptor
All Implemented Interfaces:
io.micronaut.context.event.BeanCreatedEventListener<com.rabbitmq.client.ConnectionFactory>, EventListener

@Singleton @RequiresMetrics @Requires(property="micronaut.metrics.binders.rabbitmq.enabled", notEquals="false") public class RabbitMetricsInterceptor extends Object implements io.micronaut.context.event.BeanCreatedEventListener<com.rabbitmq.client.ConnectionFactory>
Interceptor of the connection factory to set the metrics collector.
Since:
1.1.0
Author:
James Kleeh
  • Constructor Details

    • RabbitMetricsInterceptor

      public RabbitMetricsInterceptor(io.micronaut.context.BeanProvider<io.micrometer.core.instrument.MeterRegistry> meterRegistryBeanProvider, @Nullable @Property(name="micronaut.metrics.binders.rabbitmq.prefix") @Nullable String prefix, @Property(name="micronaut.metrics.binders.rabbitmq.tags") @MapFormat(transformation=FLAT) Map<String,String> tags)
      Default constructor.
      Parameters:
      meterRegistryBeanProvider - The meter registry bean provider
      prefix - The prefix
      tags - The tags
  • Method Details

    • onCreated

      public com.rabbitmq.client.ConnectionFactory onCreated(io.micronaut.context.event.BeanCreatedEvent<com.rabbitmq.client.ConnectionFactory> event)
      Specified by:
      onCreated in interface io.micronaut.context.event.BeanCreatedEventListener<com.rabbitmq.client.ConnectionFactory>