Skip to content

Commit

Permalink
Fix Micrometer Moved Package Names
Browse files Browse the repository at this point in the history
Also suppress new deprecations in retry topic code and tests.
  • Loading branch information
garyrussell committed Feb 20, 2022
1 parent 4e2f9fd commit f51ddd4
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -376,6 +377,7 @@ private KafkaListenerContainerFactory<?> resolveAndConfigureFactoryForMainEndpoi
.decorateFactoryWithoutBackOffValues(resolvedFactory, configuration.forContainerFactoryConfigurer());
}

@SuppressWarnings("deprecation")
private KafkaListenerContainerFactory<?> resolveAndConfigureFactoryForRetryEndpoint(
KafkaListenerContainerFactory<?> providedFactory,
String defaultFactoryBeanName,
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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<String> GROUP_IDS = new ThreadLocal<>();

Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ class ListenerContainerFactoryConfigurerTests {
private final ListenerContainerFactoryConfigurer.Configuration lcfcConfiguration =
new ListenerContainerFactoryConfigurer.Configuration(Collections.singletonList(backOffValue));

@SuppressWarnings("deprecation")
@Test
void shouldSetupErrorHandling() {

Expand Down Expand Up @@ -176,6 +177,7 @@ void shouldSetupErrorHandling() {

}

@SuppressWarnings("deprecation")
@Test
void shouldSetPartitionEventIntervalAndPollTimout() {

Expand Down Expand Up @@ -205,6 +207,7 @@ void shouldSetPartitionEventIntervalAndPollTimout() {
.setPollTimeout(backOffValue / 4);
}

@SuppressWarnings("deprecation")
@Test
void shouldNotOverridePollTimeoutIfNotDefault() {

Expand Down Expand Up @@ -235,6 +238,7 @@ void shouldNotOverridePollTimeoutIfNotDefault() {
.setPollTimeout(previousPollTimoutValue);
}

@SuppressWarnings("deprecation")
@Test
void shouldApplyMinimumPollTimeoutLimit() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ public KafkaTemplate<String, String> kafkaTemplate() {
return new KafkaTemplate<>(producerFactory());
}

@SuppressWarnings("deprecation")
@Bean(name = RetryTopicInternalBeanNames.RETRY_TOPIC_CONFIGURER)
public RetryTopicConfigurer retryTopicConfigurer(DestinationTopicProcessor destinationTopicProcessor,
ListenerContainerFactoryResolver containerFactoryResolver,
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f51ddd4

Please sign in to comment.