Commit a91815aa by Ryan Baxter

Made Retryer a bean.

parent 14dd2d23
...@@ -103,10 +103,16 @@ public class FeignClientsConfiguration { ...@@ -103,10 +103,16 @@ public class FeignClientsConfiguration {
} }
@Bean @Bean
@ConditionalOnMissingBean
public Retryer feignRetryer() {
return Retryer.NEVER_RETRY;
}
@Bean
@Scope("prototype") @Scope("prototype")
@ConditionalOnMissingBean @ConditionalOnMissingBean
public Feign.Builder feignBuilder() { public Feign.Builder feignBuilder(Retryer retryer) {
return Feign.builder().retryer(Retryer.NEVER_RETRY); return Feign.builder().retryer(retryer);
} }
@Bean @Bean
......
...@@ -108,7 +108,7 @@ public class FeignClientOverrideDefaultsTests { ...@@ -108,7 +108,7 @@ public class FeignClientOverrideDefaultsTests {
@Test @Test
public void overrideRetryer() { public void overrideRetryer() {
assertNull(this.context.getInstance("foo", Retryer.class)); assertEquals(Retryer.NEVER_RETRY, this.context.getInstance("foo", Retryer.class));
Retryer.Default.class.cast(this.context.getInstance("bar", Retryer.class)); Retryer.Default.class.cast(this.context.getInstance("bar", Retryer.class));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment