You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2018/01/10 08:03:03 UTC

[incubator-servicecomb-java-chassis] branch master updated (1909b0c -> c11ca31)

This is an automated email from the ASF dual-hosted git repository.

liubao pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git.


    from 1909b0c  SCB-166 rename field isHealthy -> healthy
     new e227bca  [SCB-214] AbstractServiceRegistry findServiceInstance do not process null return value,not print too much exception
     new 29d6d3b  [SCB-214] AbstractServiceRegistry findServiceInstance do not process null return value,not print too much exception
     new c11ca31  modify the exception show

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../client/http/ServiceRegistryClientImpl.java           | 16 +++++++++++-----
 .../registry/AbstractServiceRegistry.java                |  3 +++
 2 files changed, 14 insertions(+), 5 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@servicecomb.apache.org" <co...@servicecomb.apache.org>'].

[incubator-servicecomb-java-chassis] 01/03: [SCB-214] AbstractServiceRegistry findServiceInstance do not process null return value, not print too much exception

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit e227bcab013e9fe967857c36d14eab691cc08f95
Author: laijianbin <la...@huawei.com>
AuthorDate: Wed Jan 10 11:30:32 2018 +0800

    [SCB-214] AbstractServiceRegistry findServiceInstance do not process null return value,not print too much exception
---
 .../client/http/ServiceRegistryClientImpl.java              | 13 +++++++++----
 .../serviceregistry/registry/AbstractServiceRegistry.java   |  3 +++
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/service-registry/src/main/java/io/servicecomb/serviceregistry/client/http/ServiceRegistryClientImpl.java b/service-registry/src/main/java/io/servicecomb/serviceregistry/client/http/ServiceRegistryClientImpl.java
index dbc4cbe..f1ee698 100644
--- a/service-registry/src/main/java/io/servicecomb/serviceregistry/client/http/ServiceRegistryClientImpl.java
+++ b/service-registry/src/main/java/io/servicecomb/serviceregistry/client/http/ServiceRegistryClientImpl.java
@@ -169,10 +169,15 @@ public final class ServiceRegistryClientImpl implements ServiceRegistryClient {
           bodyBuffer -> {
             try {
               mInstances.setRevision(response.getHeader("X-Resource-Revision"));
-              if (response.statusCode() == 304) {
-                mInstances.setNeedRefresh(false);
-              } else {
-                mInstances.setInstancesResponse(JsonUtils.readValue(bodyBuffer.getBytes(), FindInstancesResponse.class));
+              switch (response.statusCode()) {
+                case 304:
+                  mInstances.setNeedRefresh(false);
+                  break;
+                case 200:
+                  mInstances.setInstancesResponse(JsonUtils.readValue(bodyBuffer.getBytes(), FindInstancesResponse.class));
+                  break;
+                default:
+                  LOGGER.error(bodyBuffer.toString());
               }
             } catch (Exception e) {
               LOGGER.warn(bodyBuffer.toString(), e);
diff --git a/service-registry/src/main/java/io/servicecomb/serviceregistry/registry/AbstractServiceRegistry.java b/service-registry/src/main/java/io/servicecomb/serviceregistry/registry/AbstractServiceRegistry.java
index db72748..a92e1fe 100644
--- a/service-registry/src/main/java/io/servicecomb/serviceregistry/registry/AbstractServiceRegistry.java
+++ b/service-registry/src/main/java/io/servicecomb/serviceregistry/registry/AbstractServiceRegistry.java
@@ -204,6 +204,9 @@ public abstract class AbstractServiceRegistry implements ServiceRegistry {
   public List<MicroserviceInstance> findServiceInstance(String appId, String serviceName,
       String versionRule) {
     MicroserviceInstances instances = findServiceInstances(appId, serviceName, versionRule, null);
+    if (instances == null) {
+      return null;
+    }
     return instances.getInstancesResponse().getInstances();
   }
 

-- 
To stop receiving notification emails like this one, please contact
"commits@servicecomb.apache.org" <co...@servicecomb.apache.org>.

[incubator-servicecomb-java-chassis] 02/03: [SCB-214] AbstractServiceRegistry findServiceInstance do not process null return value, not print too much exception

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit 29d6d3bb169d96f3c7a0784c542586faf03da002
Author: laijianbin <la...@huawei.com>
AuthorDate: Wed Jan 10 11:30:32 2018 +0800

    [SCB-214] AbstractServiceRegistry findServiceInstance do not process null return value,not print too much exception
---
 .../serviceregistry/client/http/ServiceRegistryClientImpl.java           | 1 +
 1 file changed, 1 insertion(+)

diff --git a/service-registry/src/main/java/io/servicecomb/serviceregistry/client/http/ServiceRegistryClientImpl.java b/service-registry/src/main/java/io/servicecomb/serviceregistry/client/http/ServiceRegistryClientImpl.java
index f1ee698..45b32ac 100644
--- a/service-registry/src/main/java/io/servicecomb/serviceregistry/client/http/ServiceRegistryClientImpl.java
+++ b/service-registry/src/main/java/io/servicecomb/serviceregistry/client/http/ServiceRegistryClientImpl.java
@@ -178,6 +178,7 @@ public final class ServiceRegistryClientImpl implements ServiceRegistryClient {
                   break;
                 default:
                   LOGGER.error(bodyBuffer.toString());
+                  break;
               }
             } catch (Exception e) {
               LOGGER.warn(bodyBuffer.toString(), e);

-- 
To stop receiving notification emails like this one, please contact
"commits@servicecomb.apache.org" <co...@servicecomb.apache.org>.

[incubator-servicecomb-java-chassis] 03/03: modify the exception show

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit c11ca3193c4d40be6d370ed6bfa0c4b478573e44
Author: laijianbin <la...@huawei.com>
AuthorDate: Wed Jan 10 14:19:24 2018 +0800

    modify the exception show
---
 .../serviceregistry/client/http/ServiceRegistryClientImpl.java        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/service-registry/src/main/java/io/servicecomb/serviceregistry/client/http/ServiceRegistryClientImpl.java b/service-registry/src/main/java/io/servicecomb/serviceregistry/client/http/ServiceRegistryClientImpl.java
index 45b32ac..9601853 100644
--- a/service-registry/src/main/java/io/servicecomb/serviceregistry/client/http/ServiceRegistryClientImpl.java
+++ b/service-registry/src/main/java/io/servicecomb/serviceregistry/client/http/ServiceRegistryClientImpl.java
@@ -177,11 +177,11 @@ public final class ServiceRegistryClientImpl implements ServiceRegistryClient {
                   mInstances.setInstancesResponse(JsonUtils.readValue(bodyBuffer.getBytes(), FindInstancesResponse.class));
                   break;
                 default:
-                  LOGGER.error(bodyBuffer.toString());
+                  LOGGER.warn(bodyBuffer.toString());
                   break;
               }
             } catch (Exception e) {
-              LOGGER.warn(bodyBuffer.toString(), e);
+              LOGGER.warn("read value failed and response message is {}", bodyBuffer.toString());
             }
             countDownLatch.countDown();
           });

-- 
To stop receiving notification emails like this one, please contact
"commits@servicecomb.apache.org" <co...@servicecomb.apache.org>.