fix:fix nacos enabled condition bugs. (#793)

pull/802/head
Haotian Zhang 2 years ago committed by GitHub
parent 30d14ec9ec
commit b9b057dcef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -24,3 +24,4 @@
- [Bugfix: fix reactor concurrent bug when get instances & fix spring-retry fuse not working bug](https://github.com/Tencent/spring-cloud-tencent/pull/774) - [Bugfix: fix reactor concurrent bug when get instances & fix spring-retry fuse not working bug](https://github.com/Tencent/spring-cloud-tencent/pull/774)
- [Standardize the name of method to create bean.](https://github.com/Tencent/spring-cloud-tencent/pull/779) - [Standardize the name of method to create bean.](https://github.com/Tencent/spring-cloud-tencent/pull/779)
- [set reporter.enabled default to true](https://github.com/Tencent/spring-cloud-tencent/pull/784) - [set reporter.enabled default to true](https://github.com/Tencent/spring-cloud-tencent/pull/784)
- [fix:fix nacos enabled condition bugs.](https://github.com/Tencent/spring-cloud-tencent/pull/793)

@ -40,6 +40,14 @@ public class DiscoveryEnabledCondition implements Condition {
conditionContext.getEnvironment().getProperty("spring.cloud.consul.discovery.enabled", "true")); conditionContext.getEnvironment().getProperty("spring.cloud.consul.discovery.enabled", "true"));
isDiscoveryEnabled |= isConsulDiscoveryEnabled; isDiscoveryEnabled |= isConsulDiscoveryEnabled;
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; return isDiscoveryEnabled;
} }
} }

@ -39,6 +39,15 @@ public class RegisterEnabledCondition implements Condition {
.getProperty("spring.cloud.consul.discovery.register", "true")); .getProperty("spring.cloud.consul.discovery.register", "true"));
isRegisterEnabled |= isConsulRegisterEnabled; isRegisterEnabled |= isConsulRegisterEnabled;
boolean isNacosRegisterEnabled = Boolean
.parseBoolean(conditionContext.getEnvironment()
.getProperty("spring.cloud.nacos.enabled", "false"))
&& Boolean.parseBoolean(conditionContext.getEnvironment()
.getProperty("spring.cloud.nacos.discovery.register-enabled", "true"));
isRegisterEnabled |= isNacosRegisterEnabled;
return isRegisterEnabled; return isRegisterEnabled;
} }
} }

@ -73,7 +73,7 @@
<revision>1.9.0-2021.0.3-SNAPSHOT</revision> <revision>1.9.0-2021.0.3-SNAPSHOT</revision>
<!-- Dependencies --> <!-- Dependencies -->
<polaris.version>1.10.1-SNAPSHOT</polaris.version> <polaris.version>1.10.1</polaris.version>
<guava.version>31.0.1-jre</guava.version> <guava.version>31.0.1-jre</guava.version>
<logback.version>1.2.11</logback.version> <logback.version>1.2.11</logback.version>
<mocktio.version>4.5.1</mocktio.version> <mocktio.version>4.5.1</mocktio.version>

Loading…
Cancel
Save