diff --git a/spring-kafka/src/main/java/org/springframework/kafka/core/MicrometerConsumerListener.java b/spring-kafka/src/main/java/org/springframework/kafka/core/MicrometerConsumerListener.java index 99aad5e878..ce30876ed0 100644 --- a/spring-kafka/src/main/java/org/springframework/kafka/core/MicrometerConsumerListener.java +++ b/spring-kafka/src/main/java/org/springframework/kafka/core/MicrometerConsumerListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 the original author or authors. + * Copyright 2020-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,9 +24,9 @@ import org.apache.kafka.clients.consumer.Consumer; -import io.micrometer.core.instrument.ImmutableTag; -import io.micrometer.core.instrument.MeterRegistry; -import io.micrometer.core.instrument.Tag; +import io.micrometer.api.instrument.ImmutableTag; +import io.micrometer.api.instrument.MeterRegistry; +import io.micrometer.api.instrument.Tag; import io.micrometer.core.instrument.binder.kafka.KafkaClientMetrics; /** diff --git a/spring-kafka/src/main/java/org/springframework/kafka/core/MicrometerProducerListener.java b/spring-kafka/src/main/java/org/springframework/kafka/core/MicrometerProducerListener.java index 88db4e9cc3..6be9e06505 100644 --- a/spring-kafka/src/main/java/org/springframework/kafka/core/MicrometerProducerListener.java +++ b/spring-kafka/src/main/java/org/springframework/kafka/core/MicrometerProducerListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 the original author or authors. + * Copyright 2020-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,9 +24,9 @@ import org.apache.kafka.clients.producer.Producer; -import io.micrometer.core.instrument.ImmutableTag; -import io.micrometer.core.instrument.MeterRegistry; -import io.micrometer.core.instrument.Tag; +import io.micrometer.api.instrument.ImmutableTag; +import io.micrometer.api.instrument.MeterRegistry; +import io.micrometer.api.instrument.Tag; import io.micrometer.core.instrument.binder.kafka.KafkaClientMetrics; /** diff --git a/spring-kafka/src/main/java/org/springframework/kafka/retrytopic/RetryTopicConfigurer.java b/spring-kafka/src/main/java/org/springframework/kafka/retrytopic/RetryTopicConfigurer.java index a0ae6bf761..5900f9c5ce 100644 --- a/spring-kafka/src/main/java/org/springframework/kafka/retrytopic/RetryTopicConfigurer.java +++ b/spring-kafka/src/main/java/org/springframework/kafka/retrytopic/RetryTopicConfigurer.java @@ -362,6 +362,7 @@ private EndpointHandlerMethod getDltEndpointHandlerMethodOrDefault(EndpointHandl return dltEndpointHandlerMethod != null ? dltEndpointHandlerMethod : DEFAULT_DLT_HANDLER; } + @SuppressWarnings("deprecation") private KafkaListenerContainerFactory resolveAndConfigureFactoryForMainEndpoint( KafkaListenerContainerFactory providedFactory, String defaultFactoryBeanName, RetryTopicConfiguration configuration) { @@ -376,6 +377,7 @@ private KafkaListenerContainerFactory resolveAndConfigureFactoryForMainEndpoi .decorateFactoryWithoutBackOffValues(resolvedFactory, configuration.forContainerFactoryConfigurer()); } + @SuppressWarnings("deprecation") private KafkaListenerContainerFactory resolveAndConfigureFactoryForRetryEndpoint( KafkaListenerContainerFactory providedFactory, String defaultFactoryBeanName, diff --git a/spring-kafka/src/main/java/org/springframework/kafka/streams/KafkaStreamsMicrometerListener.java b/spring-kafka/src/main/java/org/springframework/kafka/streams/KafkaStreamsMicrometerListener.java index 7e19eccea1..ce19aa38f9 100644 --- a/spring-kafka/src/main/java/org/springframework/kafka/streams/KafkaStreamsMicrometerListener.java +++ b/spring-kafka/src/main/java/org/springframework/kafka/streams/KafkaStreamsMicrometerListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 the original author or authors. + * Copyright 2020-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,9 +26,9 @@ import org.springframework.kafka.config.StreamsBuilderFactoryBean; -import io.micrometer.core.instrument.ImmutableTag; -import io.micrometer.core.instrument.MeterRegistry; -import io.micrometer.core.instrument.Tag; +import io.micrometer.api.instrument.ImmutableTag; +import io.micrometer.api.instrument.MeterRegistry; +import io.micrometer.api.instrument.Tag; import io.micrometer.core.instrument.binder.kafka.KafkaStreamsMetrics; /** diff --git a/spring-kafka/src/main/java/org/springframework/kafka/support/KafkaUtils.java b/spring-kafka/src/main/java/org/springframework/kafka/support/KafkaUtils.java index f69f3ed546..52c463c100 100644 --- a/spring-kafka/src/main/java/org/springframework/kafka/support/KafkaUtils.java +++ b/spring-kafka/src/main/java/org/springframework/kafka/support/KafkaUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2021 the original author or authors. + * Copyright 2018-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,7 @@ public final class KafkaUtils { * True if micrometer is on the class path. */ public static final boolean MICROMETER_PRESENT = ClassUtils.isPresent( - "io.micrometer.core.instrument.MeterRegistry", KafkaUtils.class.getClassLoader()); + "io.micrometer.api.instrument.MeterRegistry", KafkaUtils.class.getClassLoader()); private static final ThreadLocal GROUP_IDS = new ThreadLocal<>(); diff --git a/spring-kafka/src/main/java/org/springframework/kafka/support/micrometer/MicrometerHolder.java b/spring-kafka/src/main/java/org/springframework/kafka/support/micrometer/MicrometerHolder.java index f2a7fc60b9..00d11a3416 100644 --- a/spring-kafka/src/main/java/org/springframework/kafka/support/micrometer/MicrometerHolder.java +++ b/spring-kafka/src/main/java/org/springframework/kafka/support/micrometer/MicrometerHolder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 the original author or authors. + * Copyright 2020-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,10 +22,11 @@ import org.springframework.context.ApplicationContext; import org.springframework.lang.Nullable; -import io.micrometer.core.instrument.MeterRegistry; -import io.micrometer.core.instrument.Timer; -import io.micrometer.core.instrument.Timer.Builder; -import io.micrometer.core.instrument.Timer.Sample; +import io.micrometer.api.instrument.MeterRegistry; +import io.micrometer.api.instrument.Timer; +import io.micrometer.api.instrument.Timer.Builder; +import io.micrometer.api.instrument.Timer.Sample; + /** * A wrapper for micrometer timers when available on the class path. diff --git a/spring-kafka/src/test/java/org/springframework/kafka/annotation/EnableKafkaIntegrationTests.java b/spring-kafka/src/test/java/org/springframework/kafka/annotation/EnableKafkaIntegrationTests.java index e6070e79c0..b413bccd0e 100644 --- a/spring-kafka/src/test/java/org/springframework/kafka/annotation/EnableKafkaIntegrationTests.java +++ b/spring-kafka/src/test/java/org/springframework/kafka/annotation/EnableKafkaIntegrationTests.java @@ -156,9 +156,9 @@ import org.springframework.validation.Errors; import org.springframework.validation.Validator; -import io.micrometer.core.instrument.ImmutableTag; -import io.micrometer.core.instrument.MeterRegistry; -import io.micrometer.core.instrument.simple.SimpleMeterRegistry; +import io.micrometer.api.instrument.ImmutableTag; +import io.micrometer.api.instrument.MeterRegistry; +import io.micrometer.api.instrument.simple.SimpleMeterRegistry; /** * @author Gary Russell diff --git a/spring-kafka/src/test/java/org/springframework/kafka/config/KafkaStreamsCustomizerTests.java b/spring-kafka/src/test/java/org/springframework/kafka/config/KafkaStreamsCustomizerTests.java index b14d469db0..00973f9d49 100644 --- a/spring-kafka/src/test/java/org/springframework/kafka/config/KafkaStreamsCustomizerTests.java +++ b/spring-kafka/src/test/java/org/springframework/kafka/config/KafkaStreamsCustomizerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2020 the original author or authors. + * Copyright 2018-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,9 +51,9 @@ import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; -import io.micrometer.core.instrument.ImmutableTag; -import io.micrometer.core.instrument.MeterRegistry; -import io.micrometer.core.instrument.simple.SimpleMeterRegistry; +import io.micrometer.api.instrument.ImmutableTag; +import io.micrometer.api.instrument.MeterRegistry; +import io.micrometer.api.instrument.simple.SimpleMeterRegistry; /** * @author Nurettin Yilmaz diff --git a/spring-kafka/src/test/java/org/springframework/kafka/retrytopic/ListenerContainerFactoryConfigurerTests.java b/spring-kafka/src/test/java/org/springframework/kafka/retrytopic/ListenerContainerFactoryConfigurerTests.java index 48d09f926e..e5a6606dad 100644 --- a/spring-kafka/src/test/java/org/springframework/kafka/retrytopic/ListenerContainerFactoryConfigurerTests.java +++ b/spring-kafka/src/test/java/org/springframework/kafka/retrytopic/ListenerContainerFactoryConfigurerTests.java @@ -143,6 +143,7 @@ class ListenerContainerFactoryConfigurerTests { private final ListenerContainerFactoryConfigurer.Configuration lcfcConfiguration = new ListenerContainerFactoryConfigurer.Configuration(Collections.singletonList(backOffValue)); + @SuppressWarnings("deprecation") @Test void shouldSetupErrorHandling() { @@ -176,6 +177,7 @@ void shouldSetupErrorHandling() { } + @SuppressWarnings("deprecation") @Test void shouldSetPartitionEventIntervalAndPollTimout() { @@ -205,6 +207,7 @@ void shouldSetPartitionEventIntervalAndPollTimout() { .setPollTimeout(backOffValue / 4); } + @SuppressWarnings("deprecation") @Test void shouldNotOverridePollTimeoutIfNotDefault() { @@ -235,6 +238,7 @@ void shouldNotOverridePollTimeoutIfNotDefault() { .setPollTimeout(previousPollTimoutValue); } + @SuppressWarnings("deprecation") @Test void shouldApplyMinimumPollTimeoutLimit() { diff --git a/spring-kafka/src/test/java/org/springframework/kafka/retrytopic/RetryTopicLegacyFactoryConfigurerIntegrationTests.java b/spring-kafka/src/test/java/org/springframework/kafka/retrytopic/RetryTopicLegacyFactoryConfigurerIntegrationTests.java index 1cbd9200e5..b80b5d48ae 100644 --- a/spring-kafka/src/test/java/org/springframework/kafka/retrytopic/RetryTopicLegacyFactoryConfigurerIntegrationTests.java +++ b/spring-kafka/src/test/java/org/springframework/kafka/retrytopic/RetryTopicLegacyFactoryConfigurerIntegrationTests.java @@ -180,6 +180,7 @@ public KafkaTemplate kafkaTemplate() { return new KafkaTemplate<>(producerFactory()); } + @SuppressWarnings("deprecation") @Bean(name = RetryTopicInternalBeanNames.RETRY_TOPIC_CONFIGURER) public RetryTopicConfigurer retryTopicConfigurer(DestinationTopicProcessor destinationTopicProcessor, ListenerContainerFactoryResolver containerFactoryResolver, diff --git a/spring-kafka/src/test/java/org/springframework/kafka/support/micrometer/MicrometerHolderTests.java b/spring-kafka/src/test/java/org/springframework/kafka/support/micrometer/MicrometerHolderTests.java index d9fb0dc06b..8fb5d4956e 100644 --- a/spring-kafka/src/test/java/org/springframework/kafka/support/micrometer/MicrometerHolderTests.java +++ b/spring-kafka/src/test/java/org/springframework/kafka/support/micrometer/MicrometerHolderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 the original author or authors. + * Copyright 2020-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,9 +33,9 @@ import org.springframework.context.ApplicationContext; import org.springframework.test.util.ReflectionTestUtils; -import io.micrometer.core.instrument.MeterRegistry; -import io.micrometer.core.instrument.Timer; -import io.micrometer.core.instrument.simple.SimpleMeterRegistry; +import io.micrometer.api.instrument.MeterRegistry; +import io.micrometer.api.instrument.Timer; +import io.micrometer.api.instrument.simple.SimpleMeterRegistry; /** * @author Vasyl Sarzhynskyi