|
|
@ -36,12 +36,18 @@ public class DiscoveryEnabledCondition implements Condition {
|
|
|
|
|
|
|
|
|
|
|
|
boolean isConsulDiscoveryEnabled = Boolean.parseBoolean(
|
|
|
|
boolean isConsulDiscoveryEnabled = Boolean.parseBoolean(
|
|
|
|
conditionContext.getEnvironment().getProperty("spring.cloud.consul.enabled", "false"))
|
|
|
|
conditionContext.getEnvironment().getProperty("spring.cloud.consul.enabled", "false"))
|
|
|
|
&& Boolean.parseBoolean(conditionContext.getEnvironment()
|
|
|
|
&& Boolean.parseBoolean(
|
|
|
|
.getProperty("spring.cloud.consul.discovery.enabled", "true"));
|
|
|
|
conditionContext.getEnvironment().getProperty("spring.cloud.consul.discovery.enabled", "true"));
|
|
|
|
|
|
|
|
|
|
|
|
boolean isNacosEnabled = Boolean.parseBoolean(
|
|
|
|
isDiscoveryEnabled |= isConsulDiscoveryEnabled;
|
|
|
|
conditionContext.getEnvironment().getProperty("spring.cloud.nacos.discovery.enabled", "false"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return isDiscoveryEnabled || isConsulDiscoveryEnabled || isNacosEnabled;
|
|
|
|
boolean isNacosDiscoveryEnabled = Boolean.parseBoolean(
|
|
|
|
|
|
|
|
conditionContext.getEnvironment().getProperty("spring.cloud.nacos.enabled", "false"))
|
|
|
|
|
|
|
|
&& Boolean.parseBoolean(
|
|
|
|
|
|
|
|
conditionContext.getEnvironment().getProperty("spring.cloud.nacos.discovery.enabled", "true"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isDiscoveryEnabled |= isNacosDiscoveryEnabled;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return isDiscoveryEnabled;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|