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

[incubator-servicecomb-java-chassis] branch master updated (b05512b -> f91ef9e)

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

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


    from b05512b  SCB-260 update project NOTICE file
     new adc3367  SCB-272 do findServiceInstances after registered self to SC.
     new f91ef9e  SCB-272 optimize generic try log.

The 2 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              |  9 +++++++++
 .../client/http/TestServiceRegistryClientImpl.java          | 13 +++++++++++++
 .../servicecomb/swagger/converter/AbstractConverter.java    |  5 ++++-
 3 files changed, 26 insertions(+), 1 deletion(-)

-- 
To stop receiving notification emails like this one, please contact
ningjiang@apache.org.

[incubator-servicecomb-java-chassis] 02/02: SCB-272 optimize generic try log.

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

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

commit f91ef9eecc6718b9354b7eb300133f225a725a3c
Author: wujimin <wu...@huawei.com>
AuthorDate: Mon Jan 22 12:46:07 2018 +0800

    SCB-272 optimize generic try log.
---
 .../org/apache/servicecomb/swagger/converter/AbstractConverter.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/converter/AbstractConverter.java b/swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/converter/AbstractConverter.java
index 94e1b88..aca0295 100644
--- a/swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/converter/AbstractConverter.java
+++ b/swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/converter/AbstractConverter.java
@@ -70,7 +70,10 @@ public abstract class AbstractConverter implements Converter {
 
       return result;
     } catch (IllegalArgumentException e) {
-      LOGGER.info("failed to load generic class, use {}.", result.getGenericSignature(), e);
+      LOGGER.info("failed to load generic class {}, use {}. cause: {}.",
+          rawClassName,
+          result.getGenericSignature(),
+          e.getMessage());
       return result;
     }
   }

-- 
To stop receiving notification emails like this one, please contact
ningjiang@apache.org.

[incubator-servicecomb-java-chassis] 01/02: SCB-272 do findServiceInstances after registered self to SC.

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

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

commit adc3367364d57968bb6475cba49474fa9a2f612f
Author: wujimin <wu...@huawei.com>
AuthorDate: Mon Jan 22 12:45:25 2018 +0800

    SCB-272 do findServiceInstances after registered self to SC.
---
 .../client/http/ServiceRegistryClientImpl.java              |  9 +++++++++
 .../client/http/TestServiceRegistryClientImpl.java          | 13 +++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/ServiceRegistryClientImpl.java b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/ServiceRegistryClientImpl.java
index 64f9a93..d48d0bc 100644
--- a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/ServiceRegistryClientImpl.java
+++ b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/ServiceRegistryClientImpl.java
@@ -583,6 +583,15 @@ public final class ServiceRegistryClientImpl implements ServiceRegistryClient {
   @Override
   public MicroserviceInstances findServiceInstances(String consumerId, String appId, String serviceName,
       String versionRule, String revision) {
+    // must register self first, and then invoke findServiceInstances
+    if (consumerId == null) {
+      LOGGER.error("find microservice instance {}/{}/{} failed, not registered to serviceCenter.",
+          appId,
+          serviceName,
+          versionRule);
+      return null;
+    }
+
     MicroserviceInstances microserviceInstances = new MicroserviceInstances();
     IpPort ipPort = ipPortManager.getAvailableAddress();
 
diff --git a/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/client/http/TestServiceRegistryClientImpl.java b/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/client/http/TestServiceRegistryClientImpl.java
index a171531..56af6d2 100644
--- a/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/client/http/TestServiceRegistryClientImpl.java
+++ b/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/client/http/TestServiceRegistryClientImpl.java
@@ -29,6 +29,7 @@ import javax.xml.ws.Holder;
 import org.apache.log4j.Appender;
 import org.apache.log4j.Logger;
 import org.apache.log4j.spi.LoggingEvent;
+import org.apache.servicecomb.foundation.common.net.IpPort;
 import org.apache.servicecomb.serviceregistry.api.registry.Microservice;
 import org.apache.servicecomb.serviceregistry.api.registry.MicroserviceFactory;
 import org.apache.servicecomb.serviceregistry.api.response.GetExistenceResponse;
@@ -308,4 +309,16 @@ public class TestServiceRegistryClientImpl {
   public void testFindServiceInstance() {
     Assert.assertNull(oClient.findServiceInstance("aaa", "bbb"));
   }
+
+  @Test
+  public void findServiceInstance_consumerId_null() {
+    new MockUp<IpPortManager>(ipPortManager) {
+      @Mock
+      IpPort getAvailableAddress() {
+        throw new Error("must not invoke this.");
+      }
+    };
+
+    Assert.assertNull(oClient.findServiceInstance(null, "appId", "serviceName", "1.0.0+"));
+  }
 }

-- 
To stop receiving notification emails like this one, please contact
ningjiang@apache.org.