terrymanu commented on a change in pull request #3209: Nacos RegistryCenter
Added Namespace Property Configuration
URL:
https://github.com/apache/incubator-shardingsphere/pull/3209#discussion_r333438848
##########
File path:
sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-nacos/src/main/java/org/apache/shardingsphere/orchestration/reg/nacos/NacosRegistryCenter.java
##########
@@ -46,7 +46,10 @@
@Override
public void init(final RegistryCenterConfiguration config) {
try {
- configService =
NacosFactory.createConfigService(config.getServerLists());
+ Properties properties = new Properties();
+ properties.put("serverAddr", config.getServerLists());
+ properties.put("namespace",
!Strings.isNullOrEmpty(config.getNamespace()) ? config.getNamespace() : "");
Review comment:
Can adjust judgement expression to:
`null == config.getNamespace() ? "" : config.getNamespace()`
because if config.getNamespace() is empty string, you can just return empty
string directly.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services