Skip to content

Commit

Permalink
Updates to Spring Boot 2.2 and stops using proxyBeanMethods
Browse files Browse the repository at this point in the history
`proxyBeanMethods` is disablable in Spring 5.2, shipped with Spring Boot 2.2

Fixes #2863
  • Loading branch information
Adrian Cole committed Oct 18, 2019
1 parent cec3ec4 commit 9cf1734
Show file tree
Hide file tree
Showing 30 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<cassandra-driver-core.version>3.7.2</cassandra-driver-core.version>
<jooq.version>3.12.1</jooq.version>
<micrometer.version>1.3.0</micrometer.version>
<spring-boot.version>2.1.9.RELEASE</spring-boot.version>
<spring-boot.version>2.2.0.RELEASE</spring-boot.version>
<!-- MySQL connector is GPL, even if it has an OSS exception.
https://www.mysql.com/about/legal/licensing/foss-exception/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import zipkin2.server.internal.scribe.ZipkinScribeCollectorConfiguration;
import zipkin2.server.internal.ui.ZipkinUiConfiguration;

@Configuration
@Configuration(proxyBeanMethods=false)
@Import({
ArmeriaAutoConfiguration.class,
ZipkinConfiguration.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import zipkin2.storage.StorageComponent;

/** Base collector and storage configurations needed for higher-level integrations */
@Configuration
@Configuration(proxyBeanMethods=false)
public class ZipkinConfiguration {

@Bean CollectorSampler traceIdSampler(@Value("${zipkin.collector.sample-rate:1.0}") float rate) {
Expand All @@ -50,7 +50,7 @@ public class ZipkinConfiguration {
return new MicrometerCollectorMetrics(registry);
}

@Configuration
@Configuration(proxyBeanMethods=false)
@EnableConfigurationProperties(ZipkinStorageThrottleProperties.class)
@ConditionalOnThrottledStorage
static class ThrottledStorageComponentEnhancer implements BeanPostProcessor, BeanFactoryAware {
Expand Down Expand Up @@ -87,7 +87,7 @@ static class ThrottledStorageComponentEnhancer implements BeanPostProcessor, Bea
}
}

@Configuration
@Configuration(proxyBeanMethods=false)
@ConditionalOnSelfTracing
static class TracingStorageComponentEnhancer implements BeanPostProcessor {

Expand All @@ -113,7 +113,7 @@ public Object postProcessAfterInitialization(Object bean, String beanName) {
* This is a special-case configuration if there's no StorageComponent of any kind. In-Mem can
* supply both read apis, so we add two beans here.
*/
@Configuration
@Configuration(proxyBeanMethods=false)
@Conditional(StorageTypeMemAbsentOrEmpty.class)
@ConditionalOnMissingBean(StorageComponent.class)
static class InMemoryConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import zipkin2.server.internal.health.ZipkinHealthController;
import zipkin2.server.internal.prometheus.ZipkinMetricsController;

@Configuration
@Configuration(proxyBeanMethods=false)
public class ZipkinHttpConfiguration {
public static final MediaType MEDIA_TYPE_ACTUATOR =
MediaType.parse("application/vnd.spring-boot.actuator.v2+json;charset=UTF-8");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import zipkin2.storage.StorageComponent;

/** Auto-configuration for {@link ActiveMQCollector}. */
@Configuration
@Configuration(proxyBeanMethods=false)
@ConditionalOnClass(ActiveMQCollector.class)
@EnableConfigurationProperties(ZipkinActiveMQCollectorProperties.class)
@Conditional(ZipkinActiveMQCollectorConfiguration.ActiveMQUrlSet.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import zipkin2.server.internal.ConditionalOnSelfTracing;
import zipkin2.storage.StorageComponent;

@Configuration
@Configuration(proxyBeanMethods=false)
@EnableConfigurationProperties(SelfTracingProperties.class)
@ConditionalOnSelfTracing
public class ZipkinSelfTracingConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* contain a single span, which is TBinaryProtocol big-endian, then base64 encoded. Decoded spans
* are stored asynchronously.
*/
@Configuration
@Configuration(proxyBeanMethods=false)
@ConditionalOnClass(CassandraStorage.class)
@EnableConfigurationProperties(ZipkinCassandraStorageProperties.class)
@ConditionalOnProperty(name = "zipkin.storage.type", havingValue = "cassandra")
Expand Down Expand Up @@ -65,7 +65,7 @@ StorageComponent storage(
.sessionFactory(sessionFactory).build();
}

@Configuration
@Configuration(proxyBeanMethods=false)
@ConditionalOnSelfTracing
static class TracingSessionFactoryEnhancer implements BeanPostProcessor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* contain a single span, which is TBinaryProtocol big-endian, then base64 encoded. Decoded spans
* are stored asynchronously.
*/
@Configuration
@Configuration(proxyBeanMethods=false)
@ConditionalOnClass(CassandraStorage.class)
@EnableConfigurationProperties(ZipkinCassandra3StorageProperties.class)
@ConditionalOnProperty(name = "zipkin.storage.type", havingValue = "cassandra3")
Expand Down Expand Up @@ -67,7 +67,7 @@ StorageComponent storage(
.sessionFactory(sessionFactory).build();
}

@Configuration
@Configuration(proxyBeanMethods=false)
@ConditionalOnSelfTracing
static class TracingSessionFactoryEnhancer implements BeanPostProcessor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

import static zipkin2.server.internal.elasticsearch.ZipkinElasticsearchStorageProperties.Ssl;

@Configuration
@Configuration(proxyBeanMethods=false)
@EnableConfigurationProperties(ZipkinElasticsearchStorageProperties.class)
@ConditionalOnProperty(name = "zipkin.storage.type", havingValue = "elasticsearch")
@ConditionalOnMissingBean(StorageComponent.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* This collector consumes a topic, decodes spans from thrift messages and stores them subject to
* sampling policy.
*/
@Configuration
@Configuration(proxyBeanMethods=false)
@ConditionalOnClass(KafkaCollector.class)
@Conditional(ZipkinKafkaCollectorConfiguration.KafkaBootstrapServersSet.class)
@EnableConfigurationProperties(ZipkinKafkaCollectorProperties.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import zipkin2.storage.StorageComponent;
import zipkin2.storage.mysql.v1.MySQLStorage;

@Configuration
@Configuration(proxyBeanMethods=false)
@EnableConfigurationProperties(ZipkinMySQLStorageProperties.class)
@ConditionalOnClass(MySQLStorage.class)
@ConditionalOnProperty(name = "zipkin.storage.type", havingValue = "mysql")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/** Sets up the MySQL tracing in Brave as an initialization. */
@ConditionalOnSelfTracing
@ConditionalOnProperty(name = "zipkin.storage.type", havingValue = "mysql")
@Configuration
@Configuration(proxyBeanMethods=false)
class ZipkinSelfTracingMySQLStorageConfiguration extends DefaultExecuteListener {

@Autowired ZipkinMySQLStorageProperties mysql;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import org.springframework.core.annotation.Order;
import org.springframework.util.StringUtils;

@Configuration
@Configuration(proxyBeanMethods=false)
public class ZipkinPrometheusMetricsConfiguration {
// from io.micrometer.spring.web.servlet.WebMvcTags
private static final Tag URI_NOT_FOUND = Tag.of("uri", "NOT_FOUND");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import zipkin2.storage.StorageComponent;

/** Auto-configuration for {@link RabbitMQCollector}. */
@Configuration
@Configuration(proxyBeanMethods=false)
@ConditionalOnClass(RabbitMQCollector.class)
@Conditional(ZipkinRabbitMQCollectorConfiguration.RabbitMQAddressesOrUriSet.class)
@EnableConfigurationProperties(ZipkinRabbitMQCollectorProperties.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* a single span, which is TBinaryProtocol big-endian, then base64 encoded. Decoded spans are stored
* asynchronously.
*/
@Configuration
@Configuration(proxyBeanMethods=false)
@ConditionalOnClass(ScribeCollector.class)
@ConditionalOnProperty(value = "zipkin.collector.scribe.enabled", havingValue = "true")
public class ZipkinScribeCollectorConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
* Since index.html links to hashed resource names, any change to it will orphan old resources.
* That's why hashed resource age can be 365 days.
*/
@Configuration
@Configuration(proxyBeanMethods=false)
@EnableConfigurationProperties({ZipkinUiProperties.class, CompressionProperties.class})
@ConditionalOnProperty(name = "zipkin.ui.enabled", matchIfMissing = true)
public class ZipkinUiConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import zipkin2.storage.InMemoryStorage;
import zipkin2.storage.StorageComponent;

@Configuration
@Configuration(proxyBeanMethods=false)
public class InMemoryConfiguration {
@Bean public CollectorSampler sampler() {
return CollectorSampler.ALWAYS_SAMPLE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@Configuration(proxyBeanMethods=false)
public class NoOpMeterRegistryConfiguration {
@Bean public MeterRegistry noOpMeterRegistry() {
return NoopMeterRegistry.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ public class ZipkinActuatorImporterTest {
context.getBean(Include2.class);
}

@Configuration
@Configuration(proxyBeanMethods=false)
static class ActuatorImpl {
}

@Configuration
@Configuration(proxyBeanMethods=false)
static class Include1 {
}

@Configuration
@Configuration(proxyBeanMethods=false)
static class Include2 {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void httpCollector_canDisable() {
.isEqualTo(false);
}

@Configuration
@Configuration(proxyBeanMethods=false)
public static class Config {
@Bean MeterRegistry registry() {
return new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ public class ZipkinModuleImporterTest {
context.getBean(Module2.class);
}

@Configuration
@Configuration(proxyBeanMethods=false)
static class Module1 {
}

@Configuration
@Configuration(proxyBeanMethods=false)
static class Module2 {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static void registerActiveMQProperties(AnnotationConfigApplicationContext
PropertyPlaceholderAutoConfiguration.class, EnableActiveMQCollectorProperties.class);
}

@Configuration
@Configuration(proxyBeanMethods=false)
@EnableConfigurationProperties(ZipkinActiveMQCollectorProperties.class)
static class EnableActiveMQCollectorProperties {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void doesntProvideStorageComponent_whenStorageTypeNotElasticsearch() {
.isEqualTo(443);
}

@Configuration
@Configuration(proxyBeanMethods=false)
static class CustomizerConfiguration {

@Bean @Qualifier("zipkinElasticsearch") public Consumer<ClientOptionsBuilder> one() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static void registerKafkaProperties(AnnotationConfigApplicationContext co
PropertyPlaceholderAutoConfiguration.class, EnableKafkaCollectorProperties.class);
}

@Configuration
@Configuration(proxyBeanMethods=false)
@EnableConfigurationProperties(ZipkinKafkaCollectorProperties.class)
static class EnableKafkaCollectorProperties {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static void registerRabbitMQProperties(AnnotationConfigApplicationContext
PropertyPlaceholderAutoConfiguration.class, EnableRabbitMQCollectorProperties.class);
}

@Configuration
@Configuration(proxyBeanMethods=false)
@EnableConfigurationProperties(ZipkinRabbitMQCollectorProperties.class)
static class EnableRabbitMQCollectorProperties {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
class ITCassandraStorage {

@RegisterExtension CassandraStorageExtension backend =
new CassandraStorageExtension("openzipkin/zipkin-cassandra:2.17.1");
new CassandraStorageExtension("openzipkin/zipkin-cassandra:2.18.2");

@Nested
class ITTraces extends zipkin2.storage.ITTraces<CassandraStorage> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
class ITCassandraStorage {

@RegisterExtension CassandraStorageExtension backend = new CassandraStorageExtension(
"openzipkin/zipkin-cassandra:2.17.1");
"openzipkin/zipkin-cassandra:2.18.2");

@Nested
class ITTraces extends zipkin2.storage.ITTraces<CassandraStorage> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class ITElasticsearchStorageV6 extends ITElasticsearchStorage {

@RegisterExtension ElasticsearchStorageExtension backend = new ElasticsearchStorageExtension(
"openzipkin/zipkin-elasticsearch6:2.17.1");
"openzipkin/zipkin-elasticsearch6:2.18.2");

@Override ElasticsearchStorageExtension backend() {
return backend;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class ITElasticsearchStorageV7 extends ITElasticsearchStorage {

@RegisterExtension ElasticsearchStorageExtension backend = new ElasticsearchStorageExtension(
"openzipkin/zipkin-elasticsearch7:2.17.1");
"openzipkin/zipkin-elasticsearch7:2.18.2");

@Override ElasticsearchStorageExtension backend() {
return backend;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
class ITMySQLStorage {

@RegisterExtension MySQLStorageExtension backend = new MySQLStorageExtension(
"openzipkin/zipkin-mysql:2.17.1");
"openzipkin/zipkin-mysql:2.18.2");

@Nested
class ITTraces extends zipkin2.storage.ITTraces<MySQLStorage> {
Expand Down

0 comments on commit 9cf1734

Please sign in to comment.