liubao68 commented on code in PR #3261:
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/3261#discussion_r940033833


##########
service-registry/registry-service-center/src/main/java/org/apache/servicecomb/serviceregistry/task/MicroserviceRegisterTask.java:
##########
@@ -86,6 +86,24 @@ protected boolean doRegister() {
     if (!StringUtils.isEmpty(serviceId)) {
       // This microservice has been registered, so we just use the serviceId 
gotten from service center
       microservice.setServiceId(serviceId);
+
+      // Need to update microservice properties if we have modified or added 
properties of microservices.
+      Microservice microserviceTemp = new Microservice();
+      
EnvAdapterManager.INSTANCE.processMicroserviceWithAdapters(microserviceTemp);
+      if (!microserviceTemp.getProperties().isEmpty()) {
+        Map<String, String> propertiesTemp = microserviceTemp.getProperties();
+        if (srClient.getMicroservice(serviceId) != null) {
+          
microserviceTemp.setProperties(srClient.getMicroservice(serviceId).getProperties());
+          microserviceTemp.getProperties().putAll(propertiesTemp);

Review Comment:
   srClient.getMicroservice(serviceId)  is a remote RPC call, use the result 
above



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to