Add @ConditionalOnMissingBean (#467)

In Apache Camel we had some tests fail when upgrading to Spring Boot 2.1
we narrowed it down to missing `@ConditionalOnMissingBean`. I guess the
processing order for auto-configurations changed between Spring Boot 2.0
and 2.1 and this issue surfaced.

The tests that failed are here:

https://github.com/apache/camel/tree/master/components/camel-spring-cloud-consul/src/test/java/org/apache/camel/spring/cloud/consul
This commit is contained in:
Zoran Regvart
2019-01-31 18:41:06 +01:00
committed by Spencer Gibb
parent 6cfc3d37e5
commit 9f7a8f95a4

View File

@@ -59,12 +59,14 @@ public class ConsulDiscoveryClientConfiguration {
}
@Bean
@ConditionalOnMissingBean
//TODO: move to service-registry for Edgware
public HeartbeatProperties heartbeatProperties() {
return new HeartbeatProperties();
}
@Bean
@ConditionalOnMissingBean
//TODO: Split appropriate values to service-registry for Edgware
@ConditionalOnMissingBean
public ConsulDiscoveryProperties consulDiscoveryProperties(InetUtils inetUtils) {