Skip to content

Commit f51ddd4

Browse files
committed
Fix Micrometer Moved Package Names
Also suppress new deprecations in retry topic code and tests.
1 parent 4e2f9fd commit f51ddd4

File tree

11 files changed

+38
-30
lines changed

11 files changed

+38
-30
lines changed

spring-kafka/src/main/java/org/springframework/kafka/core/MicrometerConsumerListener.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 the original author or authors.
2+
* Copyright 2020-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,9 +24,9 @@
2424

2525
import org.apache.kafka.clients.consumer.Consumer;
2626

27-
import io.micrometer.core.instrument.ImmutableTag;
28-
import io.micrometer.core.instrument.MeterRegistry;
29-
import io.micrometer.core.instrument.Tag;
27+
import io.micrometer.api.instrument.ImmutableTag;
28+
import io.micrometer.api.instrument.MeterRegistry;
29+
import io.micrometer.api.instrument.Tag;
3030
import io.micrometer.core.instrument.binder.kafka.KafkaClientMetrics;
3131

3232
/**

spring-kafka/src/main/java/org/springframework/kafka/core/MicrometerProducerListener.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 the original author or authors.
2+
* Copyright 2020-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,9 +24,9 @@
2424

2525
import org.apache.kafka.clients.producer.Producer;
2626

27-
import io.micrometer.core.instrument.ImmutableTag;
28-
import io.micrometer.core.instrument.MeterRegistry;
29-
import io.micrometer.core.instrument.Tag;
27+
import io.micrometer.api.instrument.ImmutableTag;
28+
import io.micrometer.api.instrument.MeterRegistry;
29+
import io.micrometer.api.instrument.Tag;
3030
import io.micrometer.core.instrument.binder.kafka.KafkaClientMetrics;
3131

3232
/**

spring-kafka/src/main/java/org/springframework/kafka/retrytopic/RetryTopicConfigurer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ private EndpointHandlerMethod getDltEndpointHandlerMethodOrDefault(EndpointHandl
362362
return dltEndpointHandlerMethod != null ? dltEndpointHandlerMethod : DEFAULT_DLT_HANDLER;
363363
}
364364

365+
@SuppressWarnings("deprecation")
365366
private KafkaListenerContainerFactory<?> resolveAndConfigureFactoryForMainEndpoint(
366367
KafkaListenerContainerFactory<?> providedFactory,
367368
String defaultFactoryBeanName, RetryTopicConfiguration configuration) {
@@ -376,6 +377,7 @@ private KafkaListenerContainerFactory<?> resolveAndConfigureFactoryForMainEndpoi
376377
.decorateFactoryWithoutBackOffValues(resolvedFactory, configuration.forContainerFactoryConfigurer());
377378
}
378379

380+
@SuppressWarnings("deprecation")
379381
private KafkaListenerContainerFactory<?> resolveAndConfigureFactoryForRetryEndpoint(
380382
KafkaListenerContainerFactory<?> providedFactory,
381383
String defaultFactoryBeanName,

spring-kafka/src/main/java/org/springframework/kafka/streams/KafkaStreamsMicrometerListener.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 the original author or authors.
2+
* Copyright 2020-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,9 +26,9 @@
2626

2727
import org.springframework.kafka.config.StreamsBuilderFactoryBean;
2828

29-
import io.micrometer.core.instrument.ImmutableTag;
30-
import io.micrometer.core.instrument.MeterRegistry;
31-
import io.micrometer.core.instrument.Tag;
29+
import io.micrometer.api.instrument.ImmutableTag;
30+
import io.micrometer.api.instrument.MeterRegistry;
31+
import io.micrometer.api.instrument.Tag;
3232
import io.micrometer.core.instrument.binder.kafka.KafkaStreamsMetrics;
3333

3434
/**

spring-kafka/src/main/java/org/springframework/kafka/support/KafkaUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2021 the original author or authors.
2+
* Copyright 2018-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -42,7 +42,7 @@ public final class KafkaUtils {
4242
* True if micrometer is on the class path.
4343
*/
4444
public static final boolean MICROMETER_PRESENT = ClassUtils.isPresent(
45-
"io.micrometer.core.instrument.MeterRegistry", KafkaUtils.class.getClassLoader());
45+
"io.micrometer.api.instrument.MeterRegistry", KafkaUtils.class.getClassLoader());
4646

4747
private static final ThreadLocal<String> GROUP_IDS = new ThreadLocal<>();
4848

spring-kafka/src/main/java/org/springframework/kafka/support/micrometer/MicrometerHolder.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 the original author or authors.
2+
* Copyright 2020-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,10 +22,11 @@
2222
import org.springframework.context.ApplicationContext;
2323
import org.springframework.lang.Nullable;
2424

25-
import io.micrometer.core.instrument.MeterRegistry;
26-
import io.micrometer.core.instrument.Timer;
27-
import io.micrometer.core.instrument.Timer.Builder;
28-
import io.micrometer.core.instrument.Timer.Sample;
25+
import io.micrometer.api.instrument.MeterRegistry;
26+
import io.micrometer.api.instrument.Timer;
27+
import io.micrometer.api.instrument.Timer.Builder;
28+
import io.micrometer.api.instrument.Timer.Sample;
29+
2930

3031
/**
3132
* A wrapper for micrometer timers when available on the class path.

spring-kafka/src/test/java/org/springframework/kafka/annotation/EnableKafkaIntegrationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@
156156
import org.springframework.validation.Errors;
157157
import org.springframework.validation.Validator;
158158

159-
import io.micrometer.core.instrument.ImmutableTag;
160-
import io.micrometer.core.instrument.MeterRegistry;
161-
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
159+
import io.micrometer.api.instrument.ImmutableTag;
160+
import io.micrometer.api.instrument.MeterRegistry;
161+
import io.micrometer.api.instrument.simple.SimpleMeterRegistry;
162162

163163
/**
164164
* @author Gary Russell

spring-kafka/src/test/java/org/springframework/kafka/config/KafkaStreamsCustomizerTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2020 the original author or authors.
2+
* Copyright 2018-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -51,9 +51,9 @@
5151
import org.springframework.test.annotation.DirtiesContext;
5252
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
5353

54-
import io.micrometer.core.instrument.ImmutableTag;
55-
import io.micrometer.core.instrument.MeterRegistry;
56-
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
54+
import io.micrometer.api.instrument.ImmutableTag;
55+
import io.micrometer.api.instrument.MeterRegistry;
56+
import io.micrometer.api.instrument.simple.SimpleMeterRegistry;
5757

5858
/**
5959
* @author Nurettin Yilmaz

spring-kafka/src/test/java/org/springframework/kafka/retrytopic/ListenerContainerFactoryConfigurerTests.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ class ListenerContainerFactoryConfigurerTests {
143143
private final ListenerContainerFactoryConfigurer.Configuration lcfcConfiguration =
144144
new ListenerContainerFactoryConfigurer.Configuration(Collections.singletonList(backOffValue));
145145

146+
@SuppressWarnings("deprecation")
146147
@Test
147148
void shouldSetupErrorHandling() {
148149

@@ -176,6 +177,7 @@ void shouldSetupErrorHandling() {
176177

177178
}
178179

180+
@SuppressWarnings("deprecation")
179181
@Test
180182
void shouldSetPartitionEventIntervalAndPollTimout() {
181183

@@ -205,6 +207,7 @@ void shouldSetPartitionEventIntervalAndPollTimout() {
205207
.setPollTimeout(backOffValue / 4);
206208
}
207209

210+
@SuppressWarnings("deprecation")
208211
@Test
209212
void shouldNotOverridePollTimeoutIfNotDefault() {
210213

@@ -235,6 +238,7 @@ void shouldNotOverridePollTimeoutIfNotDefault() {
235238
.setPollTimeout(previousPollTimoutValue);
236239
}
237240

241+
@SuppressWarnings("deprecation")
238242
@Test
239243
void shouldApplyMinimumPollTimeoutLimit() {
240244

spring-kafka/src/test/java/org/springframework/kafka/retrytopic/RetryTopicLegacyFactoryConfigurerIntegrationTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ public KafkaTemplate<String, String> kafkaTemplate() {
180180
return new KafkaTemplate<>(producerFactory());
181181
}
182182

183+
@SuppressWarnings("deprecation")
183184
@Bean(name = RetryTopicInternalBeanNames.RETRY_TOPIC_CONFIGURER)
184185
public RetryTopicConfigurer retryTopicConfigurer(DestinationTopicProcessor destinationTopicProcessor,
185186
ListenerContainerFactoryResolver containerFactoryResolver,

spring-kafka/src/test/java/org/springframework/kafka/support/micrometer/MicrometerHolderTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 the original author or authors.
2+
* Copyright 2020-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,9 +33,9 @@
3333
import org.springframework.context.ApplicationContext;
3434
import org.springframework.test.util.ReflectionTestUtils;
3535

36-
import io.micrometer.core.instrument.MeterRegistry;
37-
import io.micrometer.core.instrument.Timer;
38-
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
36+
import io.micrometer.api.instrument.MeterRegistry;
37+
import io.micrometer.api.instrument.Timer;
38+
import io.micrometer.api.instrument.simple.SimpleMeterRegistry;
3939

4040
/**
4141
* @author Vasyl Sarzhynskyi

0 commit comments

Comments
 (0)