You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/03/14 08:46:34 UTC

[GitHub] liubao68 commented on a change in pull request #588: [SCB-394] framework version support SC which earlier than 1.0.0

liubao68 commented on a change in pull request #588: [SCB-394] framework version support SC which earlier than 1.0.0
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/588#discussion_r174385933
 
 

 ##########
 File path: service-registry/src/main/java/org/apache/servicecomb/serviceregistry/api/registry/FrameworkVersions.java
 ##########
 @@ -22,12 +22,29 @@
 import java.util.Map.Entry;
 import java.util.ServiceLoader;
 
+import org.apache.servicecomb.serviceregistry.RegistryUtils;
 import org.apache.servicecomb.serviceregistry.api.Versions;
+import org.apache.servicecomb.serviceregistry.client.ServiceRegistryClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class FrameworkVersions {
+  private static final Logger LOGGER = LoggerFactory.getLogger(FrameworkVersions.class);
   private static final ServiceLoader<Versions> frameworkVersions = ServiceLoader.load(Versions.class);
 
   public static String allVersions() {
+    ServiceRegistryClient client = RegistryUtils.getServiceRegistryClient();
+    ServiceCenterInfo serviceCenterInfo = client.getServiceCenterInfo();
+    if (serviceCenterInfo == null) {
+      LOGGER.error("query servicecenter version info failed.");
+    }
+    String scVersion = serviceCenterInfo.getVersion();
 
 Review comment:
   NPE

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services