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_r333439290
 
 

 ##########
 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() : "");
+            configService = NacosFactory.createConfigService(properties);
         } catch (NacosException e) {
 
 Review comment:
   Should add final with exception for catch block, and in the code conduct, we 
name exception variable as `ex`, not `e` 

----------------------------------------------------------------
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

Reply via email to