diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/MicrometerHolder.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/MicrometerHolder.java index fb00ae38d0..694dabe6e4 100644 --- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/MicrometerHolder.java +++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/MicrometerHolder.java @@ -16,17 +16,12 @@ package org.springframework.amqp.rabbit.listener; -import java.util.Collections; import java.util.Map; -import java.util.Map.Entry; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import org.springframework.beans.factory.NoUniqueBeanDefinitionException; -import org.springframework.beans.factory.config.BeanDefinition; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.context.ApplicationContext; -import org.springframework.context.ConfigurableApplicationContext; import org.springframework.lang.Nullable; import io.micrometer.core.instrument.MeterRegistry; @@ -71,37 +66,6 @@ final class MicrometerHolder { } } - private Map filterRegistries(Map registries, - ApplicationContext context) { - - if (registries.size() == 1) { - return registries; - } - MeterRegistry primary = null; - if (context instanceof ConfigurableApplicationContext) { - BeanDefinitionRegistry bdr = (BeanDefinitionRegistry) ((ConfigurableApplicationContext) context) - .getBeanFactory(); - for (Entry entry : registries.entrySet()) { - BeanDefinition beanDefinition = bdr.getBeanDefinition(entry.getKey()); - if (beanDefinition.isPrimary()) { - if (primary != null) { - primary = null; - break; - } - else { - primary = entry.getValue(); - } - } - } - } - if (primary != null) { - return Collections.singletonMap("primary", primary); - } - else { - return registries; - } - } - Object start() { return Timer.start(this.registry); }