You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/06/01 08:17:53 UTC

[GitHub] laijianbin commented on a change in pull request #740: [SCB-595]Compatible with old SC

laijianbin commented on a change in pull request #740: [SCB-595]Compatible with old SC
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/740#discussion_r192326614
 
 

 ##########
 File path: service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/AbstractServiceRegistry.java
 ##########
 @@ -184,6 +184,16 @@ private void loadFrameworkVersions() {
     framework.setVersion(FrameworkVersions.allVersions());
     microservice.setFramework(framework);
     microservice.setRegisterBy(CONFIG_DEFAULT_REGISTER_BY);
+    ServiceCenterInfo info = srClient.getServiceCenterInfo();
+    while (info == null) {
+      return;
+    }
+    String serviceCenterVersion = info.getVersion();
+    String validateSuccessVersion = "1.0.0";
+    int compareResult = serviceCenterVersion.compareTo(validateSuccessVersion);// 如果大于1.0.0,不需要兼容
+    if (compareResult < 1) {
+    microservice.getFramework().setVersion(null);
 
 Review comment:
   @WillemJiang In the beginning,ServiceComb registers microservice  version like this "version":"null", but after this PR(https://github.com/apache/incubator-servicecomb-java-chassis/pull/588/files) ServiceComb registers microservice  version like this"version":"ServiceComb:null",this change cause a problem (
   [2018-06-01 16:17:03,887/GMT+08:00][registry-vert.x-eventloop-thread-0][WARN]get response for org.apache.servicecomb.serviceregistry.api.response.CreateServiceResponse failed, 400:Bad Request, {"errorCode":"400001","errorMessage":"Invalid parameter(s)","detail":"Version validate failed, rule: {Length: 64,Length: ^[a-zA-Z0-9_\\-.]*$}"}
   )when use old SC (2.2.49)

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