From 318647c46da29393a41e21bcbf5941a2c603c388 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Wed, 13 Nov 2019 17:51:27 -0500 Subject: [PATCH] Add proxyBeanMethod=false to configuration. Fixes #50 --- .../resilience4j/ReactiveResilience4JAutoConfiguration.java | 6 +++--- .../resilience4j/Resilience4JAutoConfiguration.java | 6 +++--- .../ReactiveResilience4JCircuitBreakerIntegrationTest.java | 2 +- .../Resilience4JCircuitBreakerIntegrationTest.java | 2 +- .../springretry/SpringRetryAutoConfiguration.java | 4 ++-- .../SpringRetryCircuitBreakerIntegrationTest.java | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/spring-cloud-circuitbreaker-resilience4j/src/main/java/org/springframework/cloud/circuitbreaker/resilience4j/ReactiveResilience4JAutoConfiguration.java b/spring-cloud-circuitbreaker-resilience4j/src/main/java/org/springframework/cloud/circuitbreaker/resilience4j/ReactiveResilience4JAutoConfiguration.java index 902697ca..5414a978 100644 --- a/spring-cloud-circuitbreaker-resilience4j/src/main/java/org/springframework/cloud/circuitbreaker/resilience4j/ReactiveResilience4JAutoConfiguration.java +++ b/spring-cloud-circuitbreaker-resilience4j/src/main/java/org/springframework/cloud/circuitbreaker/resilience4j/ReactiveResilience4JAutoConfiguration.java @@ -38,7 +38,7 @@ /** * @author Ryan Baxter */ -@Configuration +@Configuration(proxyBeanMethods = false) @ConditionalOnClass(name = { "reactor.core.publisher.Mono", "reactor.core.publisher.Flux", "io.github.resilience4j.reactor.circuitbreaker.operator.CircuitBreakerOperator" }) @ConditionalOnProperty(name = "spring.cloud.circuitbreaker.resilience4j.enabled", @@ -51,7 +51,7 @@ public ReactiveResilience4JCircuitBreakerFactory reactiveResilience4JCircuitBrea return new ReactiveResilience4JCircuitBreakerFactory(); } - @Configuration + @Configuration(proxyBeanMethods = false) @ConditionalOnClass( name = { "reactor.core.publisher.Mono", "reactor.core.publisher.Flux" }) @ConditionalOnMissingClass({ @@ -71,7 +71,7 @@ public void init() { } - @Configuration + @Configuration(proxyBeanMethods = false) @ConditionalOnClass(name = { "reactor.core.publisher.Mono", "reactor.core.publisher.Flux", "io.github.resilience4j.micrometer.tagged.TaggedCircuitBreakerMetrics" }) diff --git a/spring-cloud-circuitbreaker-resilience4j/src/main/java/org/springframework/cloud/circuitbreaker/resilience4j/Resilience4JAutoConfiguration.java b/spring-cloud-circuitbreaker-resilience4j/src/main/java/org/springframework/cloud/circuitbreaker/resilience4j/Resilience4JAutoConfiguration.java index efd4801a..7523c3aa 100644 --- a/spring-cloud-circuitbreaker-resilience4j/src/main/java/org/springframework/cloud/circuitbreaker/resilience4j/Resilience4JAutoConfiguration.java +++ b/spring-cloud-circuitbreaker-resilience4j/src/main/java/org/springframework/cloud/circuitbreaker/resilience4j/Resilience4JAutoConfiguration.java @@ -38,7 +38,7 @@ /** * @author Ryan Baxter */ -@Configuration +@Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = "spring.cloud.circuitbreaker.resilience4j.enabled", matchIfMissing = true) public class Resilience4JAutoConfiguration { @@ -49,7 +49,7 @@ public Resilience4JCircuitBreakerFactory resilience4jCircuitBreakerFactory() { return new Resilience4JCircuitBreakerFactory(); } - @Configuration + @Configuration(proxyBeanMethods = false) @ConditionalOnMissingClass({ "io.github.resilience4j.micrometer.tagged.TaggedCircuitBreakerMetrics", "io.micrometer.core.instrument.MeterRegistry" }) @@ -68,7 +68,7 @@ public void init() { } - @Configuration + @Configuration(proxyBeanMethods = false) @ConditionalOnBean({ MeterRegistry.class }) @ConditionalOnClass(name = { "io.github.resilience4j.micrometer.tagged.TaggedCircuitBreakerMetrics" }) diff --git a/spring-cloud-circuitbreaker-resilience4j/src/test/java/org/springframework/cloud/circuitbreaker/resilience4j/ReactiveResilience4JCircuitBreakerIntegrationTest.java b/spring-cloud-circuitbreaker-resilience4j/src/test/java/org/springframework/cloud/circuitbreaker/resilience4j/ReactiveResilience4JCircuitBreakerIntegrationTest.java index 920cf0e5..01af2a85 100644 --- a/spring-cloud-circuitbreaker-resilience4j/src/test/java/org/springframework/cloud/circuitbreaker/resilience4j/ReactiveResilience4JCircuitBreakerIntegrationTest.java +++ b/spring-cloud-circuitbreaker-resilience4j/src/test/java/org/springframework/cloud/circuitbreaker/resilience4j/ReactiveResilience4JCircuitBreakerIntegrationTest.java @@ -130,7 +130,7 @@ public void test() { .isTrue(); } - @Configuration + @Configuration(proxyBeanMethods = false) @EnableAutoConfiguration @RestController protected static class Application { diff --git a/spring-cloud-circuitbreaker-resilience4j/src/test/java/org/springframework/cloud/circuitbreaker/resilience4j/Resilience4JCircuitBreakerIntegrationTest.java b/spring-cloud-circuitbreaker-resilience4j/src/test/java/org/springframework/cloud/circuitbreaker/resilience4j/Resilience4JCircuitBreakerIntegrationTest.java index c8cfac3d..16d4906b 100644 --- a/spring-cloud-circuitbreaker-resilience4j/src/test/java/org/springframework/cloud/circuitbreaker/resilience4j/Resilience4JCircuitBreakerIntegrationTest.java +++ b/spring-cloud-circuitbreaker-resilience4j/src/test/java/org/springframework/cloud/circuitbreaker/resilience4j/Resilience4JCircuitBreakerIntegrationTest.java @@ -108,7 +108,7 @@ public void testResilience4JMetricsAvailable() { .contains("resilience4j.circuitbreaker.calls")).isTrue(); } - @Configuration + @Configuration(proxyBeanMethods = false) @EnableAutoConfiguration @RestController protected static class Application { diff --git a/spring-cloud-circuitbreaker-spring-retry/src/main/java/org/springframework/cloud/circuitbreaker/springretry/SpringRetryAutoConfiguration.java b/spring-cloud-circuitbreaker-spring-retry/src/main/java/org/springframework/cloud/circuitbreaker/springretry/SpringRetryAutoConfiguration.java index 8d50a919..120cf9c9 100644 --- a/spring-cloud-circuitbreaker-spring-retry/src/main/java/org/springframework/cloud/circuitbreaker/springretry/SpringRetryAutoConfiguration.java +++ b/spring-cloud-circuitbreaker-spring-retry/src/main/java/org/springframework/cloud/circuitbreaker/springretry/SpringRetryAutoConfiguration.java @@ -33,7 +33,7 @@ /** * @author Ryan Baxter */ -@Configuration +@Configuration(proxyBeanMethods = false) @ConditionalOnClass(RetryTemplate.class) public class SpringRetryAutoConfiguration { @@ -43,7 +43,7 @@ public CircuitBreakerFactory resilience4jCircuitBreakerFactory() { return new SpringRetryCircuitBreakerFactory(); } - @Configuration + @Configuration(proxyBeanMethods = false) public static class SpringRetryCustomizerConfiguration { @Autowired(required = false) diff --git a/spring-cloud-circuitbreaker-spring-retry/src/test/java/org/springframework/cloud/circuitbreaker/springretry/SpringRetryCircuitBreakerIntegrationTest.java b/spring-cloud-circuitbreaker-spring-retry/src/test/java/org/springframework/cloud/circuitbreaker/springretry/SpringRetryCircuitBreakerIntegrationTest.java index fe44752f..9b8166a8 100644 --- a/spring-cloud-circuitbreaker-spring-retry/src/test/java/org/springframework/cloud/circuitbreaker/springretry/SpringRetryCircuitBreakerIntegrationTest.java +++ b/spring-cloud-circuitbreaker-spring-retry/src/test/java/org/springframework/cloud/circuitbreaker/springretry/SpringRetryCircuitBreakerIntegrationTest.java @@ -72,7 +72,7 @@ public void testNormal() { assertThat(service.normal()).isEqualTo("normal"); } - @Configuration + @Configuration(proxyBeanMethods = false) @EnableAutoConfiguration @RestController protected static class Application {