[servicecomb-java-chassis] 08/19: [SCB-1691] replace RestUtils and WebsocketUtils in ServiceRegistryClientImpl

2020-03-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit 1a920ebf93cfb2dd8e5a0360693fcb12231def0b
Author: yhs0092 
AuthorDate: Wed Jan 15 14:57:54 2020 +0800

[SCB-1691] replace RestUtils and WebsocketUtils in ServiceRegistryClientImpl
---
 .../client/http/ServiceRegistryClientImpl.java | 50 +++-
 .../registry/RemoteServiceRegistry.java|  2 +-
 .../serviceregistry/client/http/RestUtilsTest.java |  1 +
 .../client/http/TestClientHttp.java| 18 ++--
 .../client/http/TestServiceRegistryClientImpl.java | 53 +-
 5 files changed, 65 insertions(+), 59 deletions(-)

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 ed2e369..5ab309d 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
@@ -89,8 +89,14 @@ public final class ServiceRegistryClientImpl implements 
ServiceRegistryClient {
   // extract this, ServiceRegistryClient is better to be no status.
   private Map watchServices = new ConcurrentHashMap<>();
 
-  public ServiceRegistryClientImpl(IpPortManager ipPortManager) {
+  private RestClientUtil restClientUtil;
+
+  private WebsocketClientUtil websocketClientUtil;
+
+  public ServiceRegistryClientImpl(IpPortManager ipPortManager, 
ServiceRegistryConfig serviceRegistryConfig) {
 this.ipPortManager = ipPortManager;
+this.restClientUtil = new RestClientUtil(serviceRegistryConfig);
+this.websocketClientUtil = new WebsocketClientUtil(serviceRegistryConfig);
   }
 
   private LoadingCache> schemaCache = 
CacheBuilder.newBuilder()
@@ -113,7 +119,7 @@ public final class ServiceRegistryClientImpl implements 
ServiceRegistryClient {
 LOGGER.warn("invoke service [{}] failed, retry.", requestContext.getUri());
 
requestContext.setIpPort(ipPortManager.getNextAvailableAddress(requestContext.getIpPort()));
 requestContext.incrementRetryTimes();
-RestUtils.httpDo(requestContext, responseHandler);
+restClientUtil.httpDo(requestContext, responseHandler);
   }
 
   @VisibleForTesting
@@ -197,7 +203,7 @@ public final class ServiceRegistryClientImpl implements 
ServiceRegistryClient {
   }
 
   // temporary copy from syncHandler
-  // we will use swagger invocation to replace RestUtils later.
+  // we will use swagger invocation to replace restClientUtil later.
   private Handler syncHandlerEx(CountDownLatch countDownLatch, 
Holder holder) {
 return restResponse -> {
   RequestContext requestContext = restResponse.getRequestContext();
@@ -284,7 +290,7 @@ public final class ServiceRegistryClientImpl implements 
ServiceRegistryClient {
 IpPort ipPort = ipPortManager.getAvailableAddress();
 
 CountDownLatch countDownLatch = new CountDownLatch(1);
-RestUtils.get(ipPort,
+restClientUtil.get(ipPort,
 Const.REGISTRY_API.MICROSERVICE_OPERATION_ALL,
 new RequestParam(),
 syncHandler(countDownLatch, GetAllServicesResponse.class, holder));
@@ -305,7 +311,7 @@ public final class ServiceRegistryClientImpl implements 
ServiceRegistryClient {
 IpPort ipPort = ipPortManager.getAvailableAddress();
 
 CountDownLatch countDownLatch = new CountDownLatch(1);
-RestUtils.get(ipPort,
+restClientUtil.get(ipPort,
 Const.REGISTRY_API.MICROSERVICE_EXISTENCE,
 new RequestParam().addQueryParam("type", "microservice")
 .addQueryParam("appId", appId)
@@ -334,7 +340,7 @@ public final class ServiceRegistryClientImpl implements 
ServiceRegistryClient {
 IpPort ipPort = ipPortManager.getAvailableAddress();
 
 CountDownLatch countDownLatch = new CountDownLatch(1);
-RestUtils.get(ipPort,
+restClientUtil.get(ipPort,
 Const.REGISTRY_API.MICROSERVICE_EXISTENCE,
 new RequestParam().addQueryParam("type", "schema")
 .addQueryParam("serviceId", microserviceId)
@@ -363,7 +369,7 @@ public final class ServiceRegistryClientImpl implements 
ServiceRegistryClient {
   byte[] body = JsonUtils.writeValueAsBytes(request);
 
   CountDownLatch countDownLatch = new CountDownLatch(1);
-  RestUtils.put(ipPort,
+  restClientUtil.put(ipPort,
   String.format(Const.REGISTRY_API.MICROSERVICE_SCHEMA, 
microserviceId, schemaId),
   new RequestParam().setBody(body),
   syncHandlerEx(countDownLatch, holder));
@@ -421,7 +427,7 @@ public final class ServiceRegistryClientImpl implements 
Ser

[servicecomb-java-chassis] 03/19: [SCB-1691] add name for ServiceRegistry

2020-03-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit bf3292b0c8e36c5cf698ba9328e149dab49d1c2c
Author: yhs0092 
AuthorDate: Sat Jan 4 15:46:37 2020 +0800

[SCB-1691] add name for ServiceRegistry
---
 .../servicecomb/serviceregistry/RegistryUtils.java | 17 ++
 .../serviceregistry/ServiceRegistry.java   | 11 
 .../config/ServiceRegistryConfig.java  | 13 -
 .../registry/AbstractServiceRegistry.java  | 13 +
 .../registry/RemoteServiceRegistry.java|  3 +-
 .../serviceregistry/ServiceRegistryTest.java   | 68 ++
 .../registry/TestRemoteServiceRegistry.java|  2 +
 7 files changed, 125 insertions(+), 2 deletions(-)

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/RegistryUtils.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/RegistryUtils.java
index 400adc5..46de489 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/RegistryUtils.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/RegistryUtils.java
@@ -22,6 +22,8 @@ import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
+import java.util.regex.Matcher;
 
 import org.apache.http.client.utils.URIBuilder;
 import org.apache.servicecomb.config.ConfigUtil;
@@ -259,4 +261,19 @@ public final class RegistryUtils {
   public static Microservice getAggregatedRemoteMicroservice(String 
microserviceId) {
 return serviceRegistry.getAggregatedRemoteMicroservice(microserviceId);
   }
+
+  /**
+   * To validate whether the name is legal value.
+   * @param name name of the {@link ServiceRegistry}
+   * @throws IllegalArgumentException the input value is illegal
+   */
+  public static void validateRegistryName(String name) {
+Objects.requireNonNull(name, "null value is not allowed for the name of 
ServiceRegistry");
+Matcher checkMatcher = ServiceRegistry.REGISTRY_NAME_PATTERN.matcher(name);
+boolean isNameValid = checkMatcher.matches();
+if (!isNameValid) {
+  throw new IllegalArgumentException(
+  "Illegal registry name, the format should be " + 
ServiceRegistry.REGISTRY_NAME_FORMAT);
+}
+  }
 }
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/ServiceRegistry.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/ServiceRegistry.java
index d119cb8..0e6e1a2 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/ServiceRegistry.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/ServiceRegistry.java
@@ -19,6 +19,7 @@ package org.apache.servicecomb.serviceregistry;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.regex.Pattern;
 
 import org.apache.servicecomb.serviceregistry.api.registry.Microservice;
 import 
org.apache.servicecomb.serviceregistry.api.registry.MicroserviceInstance;
@@ -28,6 +29,16 @@ import 
org.apache.servicecomb.serviceregistry.client.http.MicroserviceInstances;
 import com.google.common.eventbus.EventBus;
 
 public interface ServiceRegistry {
+  String DEFAULT_REGISTRY_NAME = "Default";
+  String REGISTRY_NAME_FORMAT = "[a-zA-Z]([-_]?[a-zA-Z0-9])+";
+  Pattern REGISTRY_NAME_PATTERN = Pattern.compile(REGISTRY_NAME_FORMAT);
+
+  /**
+   * Get a name representing this ServiceRegistry instance.
+   * The name should be unique.
+   */
+  String getName();
+
   void init();
 
   void run();
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/config/ServiceRegistryConfig.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/config/ServiceRegistryConfig.java
index 2badf45..9d5e440 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/config/ServiceRegistryConfig.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/config/ServiceRegistryConfig.java
@@ -26,6 +26,7 @@ import org.apache.servicecomb.deployment.Deployment;
 import org.apache.servicecomb.deployment.DeploymentProvider;
 import org.apache.servicecomb.foundation.common.net.IpPort;
 import org.apache.servicecomb.foundation.common.net.NetUtils;
+import org.apache.servicecomb.serviceregistry.ServiceRegistry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -98,6 +99,8 @@ public final class ServiceRegistryConfig {
 
   public static final String WORKER_POOL_NAME = 
"registry-vert.x-worker-thread";
 
+  private String registryName = ServiceRegistry.DEFAULT_REGISTRY_NAME;
+
   private ServiceRegistryConfig() {
 
   }
@@ -124,7 +127,6 @@ public final class ServiceRegistryConfig {
 return deployInstances;
 

[servicecomb-java-chassis] 17/19: [SCB-1691] turn instance status to DOWN and wait for a period when shutdown

2020-03-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit be1660f50d7965025d79b9389bff6075c88c0f34
Author: yhs0092 
AuthorDate: Mon Feb 17 01:11:33 2020 +0800

[SCB-1691] turn instance status to DOWN and wait for a period when shutdown
---
 .../org/apache/servicecomb/core/SCBEngine.java | 41 --
 1 file changed, 39 insertions(+), 2 deletions(-)

diff --git a/core/src/main/java/org/apache/servicecomb/core/SCBEngine.java 
b/core/src/main/java/org/apache/servicecomb/core/SCBEngine.java
index e704efe..68903e6 100644
--- a/core/src/main/java/org/apache/servicecomb/core/SCBEngine.java
+++ b/core/src/main/java/org/apache/servicecomb/core/SCBEngine.java
@@ -48,6 +48,7 @@ import 
org.apache.servicecomb.core.provider.consumer.MicroserviceReferenceConfig
 import org.apache.servicecomb.core.provider.producer.ProducerProviderManager;
 import org.apache.servicecomb.core.transport.TransportManager;
 import org.apache.servicecomb.foundation.common.VendorExtensions;
+import 
org.apache.servicecomb.foundation.common.concurrency.SuppressedRunnableWrapper;
 import 
org.apache.servicecomb.foundation.common.event.EnableExceptionPropagation;
 import org.apache.servicecomb.foundation.common.event.EventManager;
 import org.apache.servicecomb.foundation.common.log.LogMarkerLeakFixUtils;
@@ -55,6 +56,8 @@ import 
org.apache.servicecomb.foundation.common.utils.SPIServiceUtils;
 import org.apache.servicecomb.foundation.vertx.VertxUtils;
 import org.apache.servicecomb.serviceregistry.RegistryUtils;
 import org.apache.servicecomb.serviceregistry.ServiceRegistry;
+import 
org.apache.servicecomb.serviceregistry.api.registry.MicroserviceInstance;
+import 
org.apache.servicecomb.serviceregistry.api.registry.MicroserviceInstanceStatus;
 import org.apache.servicecomb.serviceregistry.consumer.MicroserviceVersions;
 import 
org.apache.servicecomb.serviceregistry.definition.MicroserviceNameParser;
 import org.apache.servicecomb.serviceregistry.swagger.SwaggerLoader;
@@ -78,6 +81,10 @@ public class SCBEngine {
 
   static final long DEFAULT_WAIT_UP_TIMEOUT = 10_000;
 
+  static final String CFG_KEY_TURN_DOWN_STATUS_WAIT_SEC = 
"servicecomb.boot.turnDown.waitInSeconds";
+
+  static final long DEFAULT_TURN_DOWN_STATUS_WAIT_SEC = 0;
+
   private static final Object initializationLock = new Object();
 
   private volatile static SCBEngine INSTANCE;
@@ -315,8 +322,8 @@ public class SCBEngine {
   private void printServiceInfo() {
 StringBuilder serviceInfo = new StringBuilder();
 serviceInfo.append("Service information is shown below:\n");
-for (int i = 0; i < bootUpInformationCollectors.size(); i++) {
-  
serviceInfo.append(bootUpInformationCollectors.get(i).collect()).append('\n');
+for (BootUpInformationCollector bootUpInformationCollector : 
bootUpInformationCollectors) {
+  serviceInfo.append(bootUpInformationCollector.collect()).append('\n');
 }
 LOGGER.info(serviceInfo.toString());
   }
@@ -387,6 +394,12 @@ public class SCBEngine {
 if (shutdownHook != null) {
   Runtime.getRuntime().removeShutdownHook(shutdownHook);
 }
+
+//Step 0: turn down the status of this instance in service center,
+// so that the consumers can remove this instance record in advance
+turnDownInstanceStatus();
+blockShutDownOperationForConsumerRefresh();
+
 //Step 1: notify all component stop invoke via BEFORE_CLOSE Event
 safeTriggerEvent(EventType.BEFORE_CLOSE);
 
@@ -418,6 +431,30 @@ public class SCBEngine {
 safeTriggerEvent(EventType.AFTER_CLOSE);
   }
 
+  private void turnDownInstanceStatus() {
+RegistryUtils.executeOnEachServiceRegistry(sr -> new 
SuppressedRunnableWrapper(() -> {
+  MicroserviceInstance selfInstance = sr.getMicroserviceInstance();
+  sr.getServiceRegistryClient().updateMicroserviceInstanceStatus(
+  selfInstance.getServiceId(),
+  selfInstance.getInstanceId(),
+  MicroserviceInstanceStatus.DOWN);
+}).run());
+  }
+
+  private void blockShutDownOperationForConsumerRefresh() {
+try {
+  long turnDownWaitSeconds = DynamicPropertyFactory.getInstance()
+  .getLongProperty(CFG_KEY_TURN_DOWN_STATUS_WAIT_SEC, 
DEFAULT_TURN_DOWN_STATUS_WAIT_SEC)
+  .get();
+  if (turnDownWaitSeconds <= 0) {
+return;
+  }
+  Thread.sleep(TimeUnit.SECONDS.toMillis(turnDownWaitSeconds));
+} catch (InterruptedException e) {
+  LOGGER.warn("failed to block the shutdown procedure", e);
+}
+  }
+
   private void validAllInvocationFinished() throws InterruptedException {
 long start = System.currentTimeMillis();
 while (true) {



[servicecomb-java-chassis] 06/19: [SCB-1691] add RestClientUtil for multiple ServiceRegistryClient instance situation

2020-03-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit 096a43b6a6412caf5836ecdb88fb2caf1c1e5c73
Author: yhs0092 
AuthorDate: Wed Jan 15 09:22:59 2020 +0800

[SCB-1691] add RestClientUtil for multiple ServiceRegistryClient instance 
situation

the legacy RestUtils is preserved for compatibility and marked deprecated
---
 .../http/{RestUtils.java => RestClientUtil.java}   | 51 +-
 .../serviceregistry/client/http/RestUtils.java |  5 +++
 .../config/ServiceRegistryConfig.java  | 14 ++
 .../config/ServiceRegistryConfigBuilder.java   |  9 +++-
 4 files changed, 57 insertions(+), 22 deletions(-)

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/RestUtils.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/RestClientUtil.java
similarity index 81%
copy from 
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/RestUtils.java
copy to 
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/RestClientUtil.java
index 42d1e03..568ab57 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/RestUtils.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/RestClientUtil.java
@@ -22,8 +22,8 @@ import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.UnknownHostException;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
-import java.util.ServiceLoader;
 
 import org.apache.servicecomb.foundation.auth.AuthHeaderProvider;
 import org.apache.servicecomb.foundation.auth.SignRequest;
@@ -40,8 +40,8 @@ import io.vertx.core.http.CaseInsensitiveHeaders;
 import io.vertx.core.http.HttpClientRequest;
 import io.vertx.core.http.HttpMethod;
 
-final class RestUtils {
-  private static final Logger LOGGER = 
LoggerFactory.getLogger(RestUtils.class);
+final class RestClientUtil {
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(RestClientUtil.class);
 
   private static final String HEADER_CONTENT_TYPE = "Content-Type";
 
@@ -49,22 +49,31 @@ final class RestUtils {
 
   private static final String HEADER_TENANT_NAME = "x-domain-name";
 
-  private static final ServiceLoader authHeaderProviders =
-  ServiceLoader.load(AuthHeaderProvider.class);
+  private List authHeaderProviders;
 
-  private RestUtils() {
+  private int requestTimeout;
+
+  private String tenantName;
+
+  private HttpClientPool httpClientPool;
+
+  RestClientUtil(ServiceRegistryConfig serviceRegistryConfig) {
+this.authHeaderProviders = serviceRegistryConfig.getAuthHeaderProviders();
+this.requestTimeout = serviceRegistryConfig.getRequestTimeout();
+this.tenantName = serviceRegistryConfig.getTenantName();
+this.httpClientPool = new HttpClientPool(serviceRegistryConfig);
   }
 
-  public static void httpDo(RequestContext requestContext, 
Handler responseHandler) {
+  public void httpDo(RequestContext requestContext, Handler 
responseHandler) {
 if (requestContext.getParams().getTimeout() != 0) {
   httpDo(requestContext.getParams().getTimeout(), requestContext, 
responseHandler);
   return;
 }
-httpDo(ServiceRegistryConfig.INSTANCE.getRequestTimeout(), requestContext, 
responseHandler);
+httpDo(requestTimeout, requestContext, responseHandler);
   }
 
-  public static void httpDo(long timeout, RequestContext requestContext, 
Handler responseHandler) {
-HttpClientWithContext vertxHttpClient = 
HttpClientPool.INSTANCE.getClient();
+  public void httpDo(long timeout, RequestContext requestContext, 
Handler responseHandler) {
+HttpClientWithContext vertxHttpClient = httpClientPool.getClient();
 vertxHttpClient.runOnContext(httpClient -> {
   IpPort ipPort = requestContext.getIpPort();
   HttpMethod httpMethod = requestContext.getMethod();
@@ -146,7 +155,7 @@ final class RestUtils {
 });
   }
 
-  public static RequestContext createRequestContext(HttpMethod method, IpPort 
ipPort, String uri,
+  public RequestContext createRequestContext(HttpMethod method, IpPort ipPort, 
String uri,
   RequestParam requestParam) {
 RequestContext requestContext = new RequestContext();
 requestContext.setMethod(method);
@@ -156,7 +165,7 @@ final class RestUtils {
 return requestContext;
   }
 
-  public static SignRequest createSignRequest(String method, IpPort ipPort, 
RequestParam requestParam, String url,
+  public SignRequest createSignRequest(String method, IpPort ipPort, 
RequestParam requestParam, String url,
   Map headers) {
 SignRequest signReq = new SignRequest();
 StringBuilder endpoint = new StringBuilder("https://; + 
ipPort.getHostOrIp());
@@ -176,44 +185,44 @@ final class 

[servicecomb-java-chassis] branch master updated (908e20f -> 15cb6a7)

2020-03-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


from 908e20f  [SCB-1737] support ISO 8601 data and time (part2: HIGHWAY)
 new 0b507b4  [SCB-1691] modify instance status change interface
 new d6cbf86  [SCB-1691] Decouple the ServiceRegistry and other modules
 new bf3292b  [SCB-1691] add name for ServiceRegistry
 new 8e1f6bf  [SCB-1691] ServiceRegistryConfig just carries config value
 new a407a98  [SCB-1691] ClientPool can be instantiated
 new 096a43b  [SCB-1691] add RestClientUtil for multiple 
ServiceRegistryClient instance situation
 new 32cf126  [SCB-1691] add WebsocketClientPool for multiple 
ServiceRegistryClient instance situation
 new 1a920eb  [SCB-1691] replace RestUtils and WebsocketUtils in 
ServiceRegistryClientImpl
 new e5d89b5  [SCB-1691] add ServiceRegistryCache
 new d4e8db6  [SCB-1691] ServiceRegistry use serviceRegistryCache
 new 7828f7f  [SCB-1691] RegistryUtils manage multiple ServiceRegistry 
instances
 new c79d5e1  [SCB-1691] Each ServiceRegistry uses an isolated EventBus
 new b24a037  [SCB-1691] code improve
 new 4abbc6d  [SCB-1691] Each registry client use isolated IpPortManager
 new d2126d3  [SCB-1691] add schema and endpoint into all ServiceRegistry 
instances
 new bbd7702  [SCB-1691] support multiple TLS enabled sc clusters
 new be1660f  [SCB-1691] turn instance status to DOWN and wait for a period 
when shutdown
 new 369c578  [SCB-1691] fix CI error
 new 15cb6a7  [SCB-1691] fix according to review opinion

The 19 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:
 .../org/apache/servicecomb/core/SCBEngine.java |  63 ++-
 .../handler/impl/ProducerOperationHandler.java |   1 -
 .../consumer/MicroserviceReferenceConfig.java  |   2 +-
 .../provider/producer/ProducerBootListener.java|   9 +-
 .../core/transport/TransportManager.java   |   7 +-
 .../handler/impl/TestSimpleLoadBalanceHandler.java |   5 +-
 .../servicecomb/demo/edge/consumer/Consumer.java   |   2 +-
 .../jaxrs/client/MultiErrorCodeServiceClient.java  |   2 +-
 .../foundation/common/event/SimpleSubscriber.java  |   2 +-
 .../loadbalance/TestLoadBalanceHandler2.java   |  39 +-
 .../loadbalance/TestLoadbalanceHandler.java|   3 +-
 .../java/org/apache/servicecomb/it/ITUtils.java|   4 +-
 .../servicecomb/it/deploy/MicroserviceDeploy.java  |   2 +-
 .../it/extend/engine/GateRestTemplate.java |   2 +-
 .../it/extend/engine/ITSCBAsyncRestTemplate.java   |   4 +-
 .../it/extend/engine/ITSCBRestTemplate.java|   2 +-
 .../servicecomb/it/edge/PreLoadBootListener.java   |   2 +-
 .../async/CseAsyncClientHttpRequestTest.java   |   7 +-
 .../servicecomb/serviceregistry/RegistryUtils.java | 229 +-
 .../serviceregistry/ServiceRegistry.java   |  35 +-
 .../cache/MicroserviceInstanceCache.java   |   8 +-
 .../serviceregistry/client/IpPortManager.java  |   8 +-
 .../client/LocalServiceRegistryClientImpl.java |  30 +-
 .../client/ServiceRegistryClient.java  |  23 +-
 .../client/http/AbstractClientPool.java|  40 +-
 .../serviceregistry/client/http/ClientPool.java|   6 +-
 .../client/http/HttpClientPool.java|  36 +-
 .../http/{RestUtils.java => RestClientUtil.java}   |  57 +--
 .../serviceregistry/client/http/RestUtils.java |   5 +
 .../client/http/ServiceRegistryClientImpl.java |  94 ++--
 .../client/http/WebsocketClientPool.java   |  25 +-
 .../client/http/WebsocketClientUtil.java   | 126 ++
 .../client/http/WebsocketUtils.java|   4 +-
 .../config/ServiceRegistryConfig.java  | 473 +
 ...nfig.java => ServiceRegistryConfigBuilder.java} | 194 -
 .../serviceregistry/consumer/AppManager.java   |  14 +-
 .../consumer/MicroserviceVersion.java  |   6 +-
 .../consumer/MicroserviceVersions.java |   7 +-
 .../consumer/StaticMicroserviceVersions.java   |   5 +-
 .../diagnosis/instance/InstanceCacheCheckTask.java |   3 +-
 .../serviceregistry/discovery/DiscoveryTree.java   |   1 -
 .../registry/AbstractServiceRegistry.java  | 132 +++---
 .../registry/RemoteServiceRegistry.java|  20 +-
 .../registry/ServiceRegistryFactory.java   |  28 +-
 .../registry/cache/AggregateMicroserviceCache.java | 139 ++
 .../cache/AggregateServiceRegistryCache.java   |  99 +
 .../registry/cache/MicroserviceCache.java  |  68 +++
 .../registry/cache/MicroserviceCacheKey.java   | 122 ++
 .../cache/MicroserviceCacheRefreshedEvent.jav

[servicecomb-java-chassis] 04/19: [SCB-1691] ServiceRegistryConfig just carries config value

2020-03-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit 8e1f6bf4a22377b19577b3c8295fc1006fcad987
Author: yhs0092 
AuthorDate: Sun Feb 9 23:48:00 2020 +0800

[SCB-1691] ServiceRegistryConfig just carries config value
---
 .../config/ServiceRegistryConfig.java  | 419 -
 ...nfig.java => ServiceRegistryConfigBuilder.java} | 198 --
 .../config/TestServiceRegistryConfig.java  |  12 +-
 3 files changed, 331 insertions(+), 298 deletions(-)

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/config/ServiceRegistryConfig.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/config/ServiceRegistryConfig.java
index 9d5e440..1596077 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/config/ServiceRegistryConfig.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/config/ServiceRegistryConfig.java
@@ -17,45 +17,27 @@
 
 package org.apache.servicecomb.serviceregistry.config;
 
-import java.net.URI;
 import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
 
-import org.apache.servicecomb.deployment.Deployment;
-import org.apache.servicecomb.deployment.DeploymentProvider;
 import org.apache.servicecomb.foundation.common.net.IpPort;
-import org.apache.servicecomb.foundation.common.net.NetUtils;
 import org.apache.servicecomb.serviceregistry.ServiceRegistry;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.netflix.config.DynamicBooleanProperty;
-import com.netflix.config.DynamicIntProperty;
-import com.netflix.config.DynamicPropertyFactory;
-import com.netflix.config.DynamicStringProperty;
 
 import io.vertx.core.http.HttpVersion;
 
-/**
- * Created by   on 2016/12/23.
- */
 public final class ServiceRegistryConfig {
-  private static final Logger LOGGER = 
LoggerFactory.getLogger(ServiceRegistryConfig.class);
-
-  public static final ServiceRegistryConfig INSTANCE = new 
ServiceRegistryConfig();
+  public static final ServiceRegistryConfig INSTANCE = 
buildFromConfiguration();
 
-  private static final int DEFAULT_TIMEOUT_IN_MS = 3;
+  public static final int DEFAULT_TIMEOUT_IN_MS = 3;
 
-  private static final int DEFAULT_TIMEOUT_IN_SECONDS = 30;
+  public static final int DEFAULT_TIMEOUT_IN_SECONDS = 30;
 
-  private static final int DEFAULT_REQUEST_TIMEOUT_IN_MS = 3;
+  public static final int DEFAULT_REQUEST_TIMEOUT_IN_MS = 3;
 
-  private static final int DEFAULT_REQUEST_HEARTBEAT_TIMEOUT_IN_MS = 3000;
+  public static final int DEFAULT_REQUEST_HEARTBEAT_TIMEOUT_IN_MS = 3000;
 
-  private static final int DEFAULT_CHECK_INTERVAL_IN_S = 30;
+  public static final int DEFAULT_CHECK_INTERVAL_IN_S = 30;
 
-  private static final int DEFAULT_CHECK_TIMES = 3;
+  public static final int DEFAULT_CHECK_TIMES = 3;
 
   public static final String AUTH_ENABLED = "servicecomb.auth.enabled";
 
@@ -73,8 +55,6 @@ public final class ServiceRegistryConfig {
 
   public static final String NO_DOMAIN = "default";
 
-  private boolean ssl = true;
-
   public static final String PROXY_PRE_NAME = "servicecomb.proxy.";
 
   public static final String PROXY_ENABLE = PROXY_PRE_NAME + "enable";
@@ -101,246 +81,335 @@ public final class ServiceRegistryConfig {
 
   private String registryName = ServiceRegistry.DEFAULT_REGISTRY_NAME;
 
-  private ServiceRegistryConfig() {
+  private HttpVersion httpVersion;
+
+  private int instances;
+
+  // TODO SCB-1691 getter of this field's behavior changed, should check
+  private boolean ssl = true;
+
+  private ArrayList ipPort;
+
+  private int connectionTimeout;
+
+  private int idleConnectionTimeout;
+
+  private int idleWatchTimeout;
+
+  private int requestTimeout;
+
+  //Set the timeout of the heartbeat request
+  private int heartBeatRequestTimeout;
+
+  private int heartbeatInterval;
+
+  private int instancePullInterval;
+
+  private boolean registryAutoDiscovery;
+
+  private int resendHeartBeatTimes;
+
+  private boolean emptyInstanceProtectionEnabled;
+
+  private boolean alwaysOverrideSchema;
+
+  private boolean preferIpAddress;
+
+  private boolean watch;
+
+  private boolean clientAuthEnabled;
+
+  private String registryApiVersion;
+
+  private String tenantName;
+
+  private String domainName;
+
+  private String accessKey;
+
+  private String secretKey;
+
+  private boolean proxyEnable;
+
+  private String proxyHost;
+
+  private int proxyPort;
+
+  private String proxyUsername;
+
+  private String proxyPasswd;
 
+  /**
+   * Read the service registry related configurations and build the {@link 
ServiceRegistryConfig}
+   * object. Since most of the service registry configurations are similar, 
this method may be
+   * convenient to construct multi

[servicecomb-java-chassis] 07/19: [SCB-1691] add WebsocketClientPool for multiple ServiceRegistryClient instance situation

2020-03-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit 32cf126afb58107a0a07e99398e410b63cdb9bf2
Author: yhs0092 
AuthorDate: Wed Jan 15 10:07:45 2020 +0800

[SCB-1691] add WebsocketClientPool for multiple ServiceRegistryClient 
instance situation

the legacy WebsocketUtils is preserved for compatibility and marked 
deprecated
---
 .../client/http/HttpClientPool.java|   3 -
 .../client/http/RestClientUtil.java|   6 +-
 .../client/http/WebsocketClientPool.java   |   6 +-
 .../client/http/WebsocketClientUtil.java   | 126 +
 .../client/http/WebsocketUtils.java|   4 +-
 5 files changed, 135 insertions(+), 10 deletions(-)

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/HttpClientPool.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/HttpClientPool.java
index 46ca5ef..f4d28c8 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/HttpClientPool.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/HttpClientPool.java
@@ -27,9 +27,6 @@ import io.vertx.core.http.HttpClientOptions;
 import io.vertx.core.http.HttpVersion;
 import io.vertx.core.net.ProxyOptions;
 
-/**
- * Created by on 2017/4/28.
- */
 final class HttpClientPool extends AbstractClientPool {
 
   private static final Logger LOGGER = 
LoggerFactory.getLogger(HttpClientPool.class);
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/RestClientUtil.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/RestClientUtil.java
index 568ab57..6f0e8b0 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/RestClientUtil.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/RestClientUtil.java
@@ -43,11 +43,11 @@ import io.vertx.core.http.HttpMethod;
 final class RestClientUtil {
   private static final Logger LOGGER = 
LoggerFactory.getLogger(RestClientUtil.class);
 
-  private static final String HEADER_CONTENT_TYPE = "Content-Type";
+  static final String HEADER_CONTENT_TYPE = "Content-Type";
 
-  private static final String HEADER_USER_AGENT = "User-Agent";
+  static final String HEADER_USER_AGENT = "User-Agent";
 
-  private static final String HEADER_TENANT_NAME = "x-domain-name";
+  static final String HEADER_TENANT_NAME = "x-domain-name";
 
   private List authHeaderProviders;
 
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/WebsocketClientPool.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/WebsocketClientPool.java
index 802867a..38c17be 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/WebsocketClientPool.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/WebsocketClientPool.java
@@ -25,13 +25,13 @@ import org.slf4j.LoggerFactory;
 import io.vertx.core.http.HttpClientOptions;
 import io.vertx.core.http.HttpVersion;
 
-/**
- * Created by on 2017/4/28.
- */
 public final class WebsocketClientPool extends AbstractClientPool {
 
   private static final Logger LOGGER = 
LoggerFactory.getLogger(WebsocketClientPool.class);
 
+  /**
+   * The default instance, for default sc cluster.
+   */
   public static final WebsocketClientPool INSTANCE = new WebsocketClientPool();
 
   private WebsocketClientPool() {
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/WebsocketClientUtil.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/WebsocketClientUtil.java
new file mode 100644
index 000..9262752
--- /dev/null
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/WebsocketClientUtil.java
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for t

[servicecomb-java-chassis] 13/19: [SCB-1691] code improve

2020-03-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit b24a03799c99d8f3c729b30f37eff453d5837d18
Author: yhs0092 
AuthorDate: Fri Feb 14 09:33:35 2020 +0800

[SCB-1691] code improve

- print subscriber's exceptions only if exceptionPropagation is enabled
- remove unnecessary import
---
 .../apache/servicecomb/core/handler/impl/ProducerOperationHandler.java  | 1 -
 .../apache/servicecomb/foundation/common/event/SimpleSubscriber.java| 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/core/src/main/java/org/apache/servicecomb/core/handler/impl/ProducerOperationHandler.java
 
b/core/src/main/java/org/apache/servicecomb/core/handler/impl/ProducerOperationHandler.java
index 7f5b549..75e7492 100644
--- 
a/core/src/main/java/org/apache/servicecomb/core/handler/impl/ProducerOperationHandler.java
+++ 
b/core/src/main/java/org/apache/servicecomb/core/handler/impl/ProducerOperationHandler.java
@@ -22,7 +22,6 @@ import java.util.concurrent.CompletableFuture;
 
 import javax.ws.rs.core.Response.Status;
 
-import org.apache.servicecomb.core.Const;
 import org.apache.servicecomb.core.Handler;
 import org.apache.servicecomb.core.Invocation;
 import org.apache.servicecomb.core.exception.ExceptionUtils;
diff --git 
a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/SimpleSubscriber.java
 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/SimpleSubscriber.java
index 2ff6998..e209f44 100644
--- 
a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/SimpleSubscriber.java
+++ 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/SimpleSubscriber.java
@@ -106,8 +106,8 @@ public class SimpleSubscriber {
 try {
   dispatcher.accept(event);
 } catch (Throwable e) {
-  LOGGER.error("event process should not throw error. ", e);
   if (enableExceptionPropagation) {
+LOGGER.error("event process should not throw error. ", e);
 throw e;
   }
 }



[servicecomb-java-chassis] 18/19: [SCB-1691] fix CI error

2020-03-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit 369c57827da9969ce93af2f03340c2ac6cdda4f6
Author: yhs0092 
AuthorDate: Sat Feb 29 03:11:57 2020 +0800

[SCB-1691] fix CI error
---
 .../client/http/TestServiceRegistryClientImpl.java   | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

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 a63b7bc..61c179d 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
@@ -43,7 +43,6 @@ import 
org.apache.servicecomb.serviceregistry.api.response.GetSchemaResponse;
 import org.apache.servicecomb.serviceregistry.api.response.GetSchemasResponse;
 import org.apache.servicecomb.serviceregistry.api.response.GetServiceResponse;
 import org.apache.servicecomb.serviceregistry.client.ClientException;
-import org.apache.servicecomb.serviceregistry.client.IpPortManager;
 import 
org.apache.servicecomb.serviceregistry.client.http.ServiceRegistryClientImpl.ResponseWrapper;
 import org.apache.servicecomb.serviceregistry.config.ServiceRegistryConfig;
 import org.apache.servicecomb.serviceregistry.definition.DefinitionConst;
@@ -69,9 +68,6 @@ import mockit.MockUp;
 import mockit.Mocked;
 
 public class TestServiceRegistryClientImpl {
-  @Mocked
-  private IpPortManager ipPortManager;
-
   private ServiceRegistryClientImpl oClient = null;
 
   private Microservice microservice = new Microservice();
@@ -161,6 +157,14 @@ public class TestServiceRegistryClientImpl {
 
   @Test
   public void testRegisterSchemaNoResponse() {
+new MockUp() {
+  @Mock
+  void put(IpPort ipPort, String uri, RequestParam requestParam,
+  Handler responseHandler) {
+// do nothing to mock null response
+  }
+};
+
 new RegisterSchemaTester() {
   void doRun(java.util.List events) {
 oClient.registerSchema("msid", "schemaId", "content");



[servicecomb-java-chassis] 15/19: [SCB-1691] add schema and endpoint into all ServiceRegistry instances

2020-03-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit d2126d3f68c2414287d4462c372b903b0237141d
Author: yhs0092 
AuthorDate: Sun Feb 16 21:32:44 2020 +0800

[SCB-1691] add schema and endpoint into all ServiceRegistry instances
---
 .../servicecomb/core/provider/producer/ProducerBootListener.java | 9 +++--
 .../org/apache/servicecomb/core/transport/TransportManager.java  | 7 +--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git 
a/core/src/main/java/org/apache/servicecomb/core/provider/producer/ProducerBootListener.java
 
b/core/src/main/java/org/apache/servicecomb/core/provider/producer/ProducerBootListener.java
index aec2e33..4b85909 100644
--- 
a/core/src/main/java/org/apache/servicecomb/core/provider/producer/ProducerBootListener.java
+++ 
b/core/src/main/java/org/apache/servicecomb/core/provider/producer/ProducerBootListener.java
@@ -28,6 +28,7 @@ import 
org.apache.servicecomb.core.definition.MicroserviceMeta;
 import org.apache.servicecomb.core.definition.OperationMeta;
 import org.apache.servicecomb.core.definition.SchemaMeta;
 import org.apache.servicecomb.foundation.common.utils.IOUtils;
+import org.apache.servicecomb.serviceregistry.RegistryUtils;
 import org.apache.servicecomb.serviceregistry.api.Const;
 import org.apache.servicecomb.serviceregistry.api.registry.BasePath;
 import org.apache.servicecomb.serviceregistry.api.registry.Microservice;
@@ -65,10 +66,14 @@ public class ProducerBootListener implements BootListener {
   microserviceMeta.getMicroserviceName(),
   schemaMeta.getSchemaId(),
   content);
-  microservice.addSchema(schemaMeta.getSchemaId(), content);
+  RegistryUtils.executeOnEachServiceRegistry(sr -> {
+sr.getMicroservice().addSchema(schemaMeta.getSchemaId(), content);
+  });
 }
 
-saveBasePaths(microserviceMeta, microservice);
+RegistryUtils.executeOnEachServiceRegistry(sr -> {
+  saveBasePaths(microserviceMeta, sr.getMicroservice());
+});
   }
 
   // just compatible to old 3rd components, servicecomb not use it..
diff --git 
a/core/src/main/java/org/apache/servicecomb/core/transport/TransportManager.java
 
b/core/src/main/java/org/apache/servicecomb/core/transport/TransportManager.java
index 2e02279..a52c93b 100644
--- 
a/core/src/main/java/org/apache/servicecomb/core/transport/TransportManager.java
+++ 
b/core/src/main/java/org/apache/servicecomb/core/transport/TransportManager.java
@@ -29,6 +29,7 @@ import org.apache.servicecomb.core.SCBEngine;
 import org.apache.servicecomb.core.Transport;
 import 
org.apache.servicecomb.foundation.common.exceptions.ServiceCombException;
 import org.apache.servicecomb.foundation.common.utils.SPIServiceUtils;
+import org.apache.servicecomb.serviceregistry.RegistryUtils;
 import org.apache.servicecomb.serviceregistry.api.registry.Microservice;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -60,8 +61,10 @@ public class TransportManager {
 Endpoint endpoint = transport.getPublishEndpoint();
 if (endpoint != null && endpoint.getEndpoint() != null) {
   LOGGER.info("endpoint to publish: {}", endpoint.getEndpoint());
-  Microservice microservice = 
scbEngine.getServiceRegistry().getMicroservice();
-  
microservice.getInstance().getEndpoints().add(endpoint.getEndpoint());
+  RegistryUtils.executeOnEachServiceRegistry(sr -> {
+Microservice microservice = sr.getMicroservice();
+
microservice.getInstance().getEndpoints().add(endpoint.getEndpoint());
+  });
 }
 continue;
   }



[servicecomb-java-chassis] 12/19: [SCB-1691] Each ServiceRegistry uses an isolated EventBus

2020-03-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit c79d5e122b2d526fe4227ecbfb5061f5d174859e
Author: yhs0092 
AuthorDate: Tue Feb 11 21:16:33 2020 +0800

[SCB-1691] Each ServiceRegistry uses an isolated EventBus
---
 .../servicecomb/serviceregistry/RegistryUtils.java | 38 +++---
 .../registry/ServiceRegistryFactory.java   |  8 +
 2 files changed, 42 insertions(+), 4 deletions(-)

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/RegistryUtils.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/RegistryUtils.java
index 49f28e2..3f99eae 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/RegistryUtils.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/RegistryUtils.java
@@ -25,6 +25,7 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import java.util.concurrent.atomic.AtomicInteger;
 import java.util.function.Consumer;
 import java.util.function.Function;
 import java.util.regex.Matcher;
@@ -52,10 +53,13 @@ import 
org.apache.servicecomb.serviceregistry.registry.cache.MicroserviceCache;
 import 
org.apache.servicecomb.serviceregistry.registry.cache.MicroserviceCache.MicroserviceCacheStatus;
 import 
org.apache.servicecomb.serviceregistry.registry.cache.MicroserviceCacheKey;
 import org.apache.servicecomb.serviceregistry.swagger.SwaggerLoader;
+import 
org.apache.servicecomb.serviceregistry.task.MicroserviceInstanceRegisterTask;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.util.StringUtils;
 
 import com.google.common.base.Charsets;
+import com.google.common.eventbus.Subscribe;
 import com.google.common.hash.Hashing;
 import com.netflix.config.DynamicPropertyFactory;
 
@@ -115,14 +119,13 @@ public final class RegistryUtils {
 
   private static void initializeServiceRegistries(MicroserviceDefinition 
microserviceDefinition) {
 serviceRegistry =
-ServiceRegistryFactory
-.create(EventManager.eventBus, ServiceRegistryConfig.INSTANCE, 
microserviceDefinition);
+ServiceRegistryFactory.create(ServiceRegistryConfig.INSTANCE, 
microserviceDefinition);
 EXTRA_SERVICE_REGISTRY_CONFIGS.forEach((k, v) -> {
-  ServiceRegistry serviceRegistry = ServiceRegistryFactory
-  .create(EventManager.getEventBus(), v, microserviceDefinition);
+  ServiceRegistry serviceRegistry = ServiceRegistryFactory.create(v, 
microserviceDefinition);
   addExtraServiceRegistry(serviceRegistry);
 });
 executeOnEachServiceRegistry(ServiceRegistry::init);
+executeOnEachServiceRegistry(AfterServiceInstanceRegistryHandler::new);
   }
 
   public static void run() {
@@ -411,4 +414,31 @@ public final class RegistryUtils {
   "Illegal registry name, the format should be " + 
ServiceRegistry.REGISTRY_NAME_FORMAT);
 }
   }
+
+  public static class AfterServiceInstanceRegistryHandler {
+private static AtomicInteger instanceRegisterCounter = new 
AtomicInteger(EXTRA_SERVICE_REGISTRIES.size() + 1);
+
+private ServiceRegistry serviceRegistry;
+
+AfterServiceInstanceRegistryHandler(ServiceRegistry serviceRegistry) {
+  this.serviceRegistry = serviceRegistry;
+  serviceRegistry.getEventBus().register(this);
+}
+
+@Subscribe
+public void afterRegistryInstance(MicroserviceInstanceRegisterTask 
microserviceInstanceRegisterTask) {
+  LOGGER.info("receive MicroserviceInstanceRegisterTask event of [{}]", 
serviceRegistry.getName());
+  if 
(StringUtils.isEmpty(serviceRegistry.getMicroserviceInstance().getInstanceId()))
 {
+return;
+  }
+
+  LOGGER.info("ServiceRegistry[{}] has completed instance registry", 
serviceRegistry.getName());
+  EventManager.unregister(this);
+
+  if (instanceRegisterCounter.decrementAndGet() > 0) {
+return;
+  }
+  EventManager.getEventBus().post(microserviceInstanceRegisterTask);
+}
+  }
 }
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/ServiceRegistryFactory.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/ServiceRegistryFactory.java
index 0dab855..a672bbf 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/ServiceRegistryFactory.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/ServiceRegistryFactory.java
@@ -52,8 +52,16 @@ public final class ServiceRegistryFactory {
 return new LocalServiceRegistry(eventBus, serviceRegistryConfig, 
microserviceDefinition).localFile(localFile);
   }
 
+  public static ServiceRegistry create(ServiceRegistryConfig 
serviceRegistryC

[servicecomb-java-chassis] 10/19: [SCB-1691] ServiceRegistry use serviceRegistryCache

2020-03-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit d4e8db6970c4a8e5b383c0b9ebc114118497757e
Author: yhs0092 
AuthorDate: Sat Feb 15 19:07:07 2020 +0800

[SCB-1691] ServiceRegistry use serviceRegistryCache
---
 .../servicecomb/serviceregistry/RegistryUtils.java | 33 +
 .../consumer/MicroserviceVersions.java |  2 +-
 .../registry/AbstractServiceRegistry.java  | 80 ++
 .../registry/RemoteServiceRegistry.java|  5 +-
 .../serviceregistry/RegistryUtilsTest.java | 77 +
 5 files changed, 151 insertions(+), 46 deletions(-)

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/RegistryUtils.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/RegistryUtils.java
index 46de489..2f93bd6 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/RegistryUtils.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/RegistryUtils.java
@@ -20,6 +20,7 @@ package org.apache.servicecomb.serviceregistry;
 import java.net.InetSocketAddress;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
@@ -33,6 +34,7 @@ import org.apache.servicecomb.foundation.common.net.IpPort;
 import org.apache.servicecomb.foundation.common.net.NetUtils;
 import org.apache.servicecomb.serviceregistry.api.registry.Microservice;
 import 
org.apache.servicecomb.serviceregistry.api.registry.MicroserviceInstance;
+import 
org.apache.servicecomb.serviceregistry.api.response.FindInstancesResponse;
 import org.apache.servicecomb.serviceregistry.cache.InstanceCacheManager;
 import org.apache.servicecomb.serviceregistry.cache.InstanceCacheManagerNew;
 import org.apache.servicecomb.serviceregistry.client.ServiceRegistryClient;
@@ -41,6 +43,7 @@ import 
org.apache.servicecomb.serviceregistry.config.ServiceRegistryConfig;
 import org.apache.servicecomb.serviceregistry.consumer.AppManager;
 import 
org.apache.servicecomb.serviceregistry.definition.MicroserviceDefinition;
 import org.apache.servicecomb.serviceregistry.registry.ServiceRegistryFactory;
+import org.apache.servicecomb.serviceregistry.registry.cache.MicroserviceCache;
 import org.apache.servicecomb.serviceregistry.swagger.SwaggerLoader;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -250,6 +253,36 @@ public final class RegistryUtils {
 return serviceRegistry.findServiceInstances(appId, serviceName, 
versionRule, revision);
   }
 
+  /**
+   * for compatibility
+   */
+  public static MicroserviceInstances 
convertCacheToMicroserviceInstances(MicroserviceCache microserviceCache) {
+MicroserviceInstances microserviceInstances = new MicroserviceInstances();
+switch (microserviceCache.getStatus()) {
+  case SERVICE_NOT_FOUND:
+microserviceInstances.setMicroserviceNotExist(true);
+microserviceInstances.setNeedRefresh(false);
+microserviceInstances.setRevision("");
+microserviceInstances.setInstancesResponse(null);
+return microserviceInstances;
+  case NO_CHANGE:
+microserviceInstances.setMicroserviceNotExist(false);
+microserviceInstances.setNeedRefresh(false);
+microserviceInstances.setRevision(microserviceCache.getRevisionId());
+return microserviceInstances;
+  case REFRESHED:
+microserviceInstances.setMicroserviceNotExist(false);
+microserviceInstances.setNeedRefresh(true);
+microserviceInstances.setRevision(microserviceCache.getRevisionId());
+FindInstancesResponse findInstancesResponse = new 
FindInstancesResponse();
+findInstancesResponse.setInstances(new 
ArrayList<>(microserviceCache.getInstances()));
+microserviceInstances.setInstancesResponse(findInstancesResponse);
+return microserviceInstances;
+  default:
+return null;
+}
+  }
+
   public static String calcSchemaSummary(String schemaContent) {
 return Hashing.sha256().newHasher().putString(schemaContent, 
Charsets.UTF_8).hash().toString();
   }
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/MicroserviceVersions.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/MicroserviceVersions.java
index 8802a15..5dc1cec 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/MicroserviceVersions.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/MicroserviceVersions.java
@@ -166,7 +166,7 @@ public class MicroserviceVersions {
   return;
 }
 
-if (!microserviceInstances.isNeedRefresh()) {
+if (null != revision &am

[servicecomb-java-chassis] 14/19: [SCB-1691] Each registry client use isolated IpPortManager

2020-03-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit 4abbc6def108d196679618491542da48318129ca
Author: yhs0092 
AuthorDate: Sun Feb 16 16:05:09 2020 +0800

[SCB-1691] Each registry client use isolated IpPortManager
---
 .../serviceregistry/client/IpPortManager.java  |  8 +--
 .../client/http/ServiceRegistryClientImpl.java | 14 -
 .../registry/AbstractServiceRegistry.java  |  9 +---
 .../registry/RemoteServiceRegistry.java| 12 +
 .../serviceregistry/client/TestIpPortManager.java  |  7 +--
 .../client/http/TestClientHttp.java| 62 ++
 .../client/http/TestServiceRegistryClientImpl.java |  2 +-
 .../registry/TestRemoteServiceRegistry.java|  8 ---
 8 files changed, 50 insertions(+), 72 deletions(-)

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/IpPortManager.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/IpPortManager.java
index 18115c1..947a386 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/IpPortManager.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/IpPortManager.java
@@ -30,7 +30,9 @@ import 
org.apache.servicecomb.foundation.common.net.URIEndpointObject;
 import org.apache.servicecomb.serviceregistry.cache.CacheEndpoint;
 import org.apache.servicecomb.serviceregistry.cache.InstanceCache;
 import org.apache.servicecomb.serviceregistry.cache.InstanceCacheManager;
+import org.apache.servicecomb.serviceregistry.cache.InstanceCacheManagerNew;
 import org.apache.servicecomb.serviceregistry.config.ServiceRegistryConfig;
+import org.apache.servicecomb.serviceregistry.consumer.AppManager;
 import org.apache.servicecomb.serviceregistry.definition.DefinitionConst;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -40,7 +42,7 @@ public class IpPortManager {
 
   private ServiceRegistryConfig serviceRegistryConfig;
 
-  private InstanceCacheManager instanceCacheManager;
+  InstanceCacheManager instanceCacheManager;
 
   private String defaultTransport = "rest";
 
@@ -60,9 +62,9 @@ public class IpPortManager {
 return maxRetryTimes;
   }
 
-  public IpPortManager(ServiceRegistryConfig serviceRegistryConfig, 
InstanceCacheManager instanceCacheManager) {
+  public IpPortManager(ServiceRegistryConfig serviceRegistryConfig) {
 this.serviceRegistryConfig = serviceRegistryConfig;
-this.instanceCacheManager = instanceCacheManager;
+this.instanceCacheManager = new InstanceCacheManagerNew(new AppManager());
 
 defaultTransport = serviceRegistryConfig.getTransport();
 defaultIpPort = serviceRegistryConfig.getIpPort();
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 5ab309d..1201907 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
@@ -61,6 +61,8 @@ import 
org.apache.servicecomb.serviceregistry.client.ClientException;
 import org.apache.servicecomb.serviceregistry.client.IpPortManager;
 import org.apache.servicecomb.serviceregistry.client.ServiceRegistryClient;
 import org.apache.servicecomb.serviceregistry.config.ServiceRegistryConfig;
+import org.apache.servicecomb.serviceregistry.task.HeartbeatResult;
+import 
org.apache.servicecomb.serviceregistry.task.MicroserviceInstanceHeartbeatTask;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -68,6 +70,7 @@ import com.google.common.annotations.VisibleForTesting;
 import com.google.common.cache.CacheBuilder;
 import com.google.common.cache.CacheLoader;
 import com.google.common.cache.LoadingCache;
+import com.google.common.eventbus.Subscribe;
 
 import io.netty.handler.codec.http.HttpStatusClass;
 import io.vertx.core.Handler;
@@ -93,8 +96,8 @@ public final class ServiceRegistryClientImpl implements 
ServiceRegistryClient {
 
   private WebsocketClientUtil websocketClientUtil;
 
-  public ServiceRegistryClientImpl(IpPortManager ipPortManager, 
ServiceRegistryConfig serviceRegistryConfig) {
-this.ipPortManager = ipPortManager;
+  public ServiceRegistryClientImpl(ServiceRegistryConfig 
serviceRegistryConfig) {
+this.ipPortManager = new IpPortManager(serviceRegistryConfig);
 this.restClientUtil = new RestClientUtil(serviceRegistryConfig);
 this.websocketClientUtil = new WebsocketClientUtil(serviceRegistryConfig);
   }
@@ -943,4 +946,11 @@ public final class ServiceRegistryClientImpl implements 
ServiceRegistryClient {
 }
 

[servicecomb-java-chassis] 19/19: [SCB-1691] fix according to review opinion

2020-03-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit 15cb6a740e5a106e9fc6b577f7b26b365ddbd4db
Author: yhs0092 
AuthorDate: Fri Mar 6 19:44:00 2020 +0800

[SCB-1691] fix according to review opinion
---
 .../java/org/apache/servicecomb/serviceregistry/RegistryUtils.java  | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/RegistryUtils.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/RegistryUtils.java
index 3f99eae..28e881d 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/RegistryUtils.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/RegistryUtils.java
@@ -86,7 +86,7 @@ public final class RegistryUtils {
 
   private static final Map EXTRA_SERVICE_REGISTRIES = 
new LinkedHashMap<>();
 
-  static AggregateServiceRegistryCache aggregateServiceRegistryCache;
+  private static AggregateServiceRegistryCache aggregateServiceRegistryCache;
 
   private RegistryUtils() {
   }
@@ -107,9 +107,7 @@ public final class RegistryUtils {
 ArrayList serviceRegistries = new ArrayList<>();
 executeOnEachServiceRegistry(serviceRegistries::add);
 aggregateServiceRegistryCache = new 
AggregateServiceRegistryCache(serviceRegistries);
-aggregateServiceRegistryCache.setCacheRefreshedWatcher(refreshedCaches -> {
-  appManager.pullInstances();
-});
+aggregateServiceRegistryCache.setCacheRefreshedWatcher(refreshedCaches -> 
appManager.pullInstances());
 
 executeOnEachServiceRegistry(
 serviceRegistry -> serviceRegistry



[servicecomb-java-chassis] 16/19: [SCB-1691] support multiple TLS enabled sc clusters

2020-03-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit bbd7702fbee7df950ef43d703f604f4b3fc90140
Author: yhs0092 
AuthorDate: Mon Feb 17 09:19:31 2020 +0800

[SCB-1691] support multiple TLS enabled sc clusters

- RemoteServiceRegistry create ServiceRegistryClient by the constructor in 
ServiceRegistryConfig
- AbstractClientPool accept ServiceRegistryConfig in constructor
- Allow to specify registry client TLS and proxy config by custom tags
---
 .../client/http/AbstractClientPool.java| 12 +--
 .../client/http/HttpClientPool.java| 13 +++
 .../client/http/WebsocketClientPool.java   | 11 +++---
 .../config/ServiceRegistryConfig.java  | 41 ++
 .../registry/RemoteServiceRegistry.java|  3 +-
 .../client/http/TestHttpClientPool.java| 24 ++---
 .../client/http/TestWebsocketClientPool.java   | 12 +--
 7 files changed, 94 insertions(+), 22 deletions(-)

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/AbstractClientPool.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/AbstractClientPool.java
index 968d858..c709692 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/AbstractClientPool.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/AbstractClientPool.java
@@ -41,17 +41,23 @@ import io.vertx.core.http.HttpClientOptions;
 abstract class AbstractClientPool implements ClientPool {
   private static final Logger LOGGER = 
LoggerFactory.getLogger(AbstractClientPool.class);
 
+  private ServiceRegistryConfig serviceRegistryConfig;
+
   private HttpClientOptions httpClientOptions;
 
   private ClientPoolManager clientMgr;
 
-  AbstractClientPool(HttpClientOptions httpClientOptions) {
-this.httpClientOptions = httpClientOptions;
+  AbstractClientPool(ServiceRegistryConfig serviceRegistryConfig) {
+this.serviceRegistryConfig = serviceRegistryConfig;
+this.httpClientOptions = 
getHttpClientOptionsFromConfigurations(serviceRegistryConfig);
 create();
   }
 
   protected abstract boolean isWorker();
 
+  protected abstract HttpClientOptions getHttpClientOptionsFromConfigurations(
+  ServiceRegistryConfig serviceRegistryConfig);
+
   public HttpClientWithContext getClient() {
 return this.clientMgr.findThreadBindClientPool();
   }
@@ -64,7 +70,7 @@ abstract class AbstractClientPool implements ClientPool {
 
 // 这里面是同步接口,且好像直接在事件线程中用,保险起见,先使用独立的vertx实例
 VertxOptions vertxOptions = new VertxOptions()
-
.setAddressResolverOptions(AddressResolverConfig.getAddressResover(ServiceRegistryConfig.SSL_KEY))
+
.setAddressResolverOptions(AddressResolverConfig.getAddressResover(serviceRegistryConfig.getSslConfigTag()))
 .setEventLoopPoolSize(property.get());
 Vertx vertx = VertxUtils.getOrCreateVertxByName("registry", vertxOptions);
 clientMgr = new ClientPoolManager<>(vertx, new 
HttpClientPoolFactory(httpClientOptions));
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/HttpClientPool.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/HttpClientPool.java
index f4d28c8..962a81c 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/HttpClientPool.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/HttpClientPool.java
@@ -27,7 +27,7 @@ import io.vertx.core.http.HttpClientOptions;
 import io.vertx.core.http.HttpVersion;
 import io.vertx.core.net.ProxyOptions;
 
-final class HttpClientPool extends AbstractClientPool {
+class HttpClientPool extends AbstractClientPool {
 
   private static final Logger LOGGER = 
LoggerFactory.getLogger(HttpClientPool.class);
 
@@ -37,11 +37,11 @@ final class HttpClientPool extends AbstractClientPool {
   public static final HttpClientPool INSTANCE = new HttpClientPool();
 
   private HttpClientPool() {
-
super(getHttpClientOptionsFromConfigurations(ServiceRegistryConfig.INSTANCE));
+super(ServiceRegistryConfig.INSTANCE);
   }
 
   HttpClientPool(ServiceRegistryConfig serviceRegistryConfig) {
-super(getHttpClientOptionsFromConfigurations(serviceRegistryConfig));
+super(serviceRegistryConfig);
   }
 
   @Override
@@ -49,7 +49,8 @@ final class HttpClientPool extends AbstractClientPool {
 return false;
   }
 
-  static HttpClientOptions 
getHttpClientOptionsFromConfigurations(ServiceRegistryConfig 
serviceRegistryConfig) {
+  @Override
+  protected HttpClientOptions 
getHttpClientOptionsFromConfigurations(ServiceRegistryConfig 
serviceRegistryConfig) {
 HttpVersion ver = serviceRegistryConfi

[servicecomb-java-chassis] 05/19: [SCB-1691] ClientPool can be instantiated

2020-03-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit a407a983435b4747fc5df8862c1adf1fe6592fa0
Author: yhs0092 
AuthorDate: Tue Jan 14 16:27:11 2020 +0800

[SCB-1691] ClientPool can be instantiated
---
 .../client/http/AbstractClientPool.java| 34 --
 .../serviceregistry/client/http/ClientPool.java|  6 +---
 .../client/http/HttpClientPool.java| 32 
 .../client/http/WebsocketClientPool.java   | 16 ++
 .../client/http/TestHttpClientPool.java| 12 +---
 .../client/http/TestWebsocketClientPool.java   |  7 +++--
 6 files changed, 63 insertions(+), 44 deletions(-)

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/AbstractClientPool.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/AbstractClientPool.java
index 5992c05..968d858 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/AbstractClientPool.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/AbstractClientPool.java
@@ -17,9 +17,6 @@
 
 package org.apache.servicecomb.serviceregistry.client.http;
 
-import com.netflix.config.DynamicIntProperty;
-import com.netflix.config.DynamicPropertyFactory;
-
 import org.apache.servicecomb.foundation.vertx.AddressResolverConfig;
 import org.apache.servicecomb.foundation.vertx.VertxUtils;
 import org.apache.servicecomb.foundation.vertx.client.ClientPoolManager;
@@ -30,6 +27,9 @@ import 
org.apache.servicecomb.serviceregistry.config.ServiceRegistryConfig;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.netflix.config.DynamicIntProperty;
+import com.netflix.config.DynamicPropertyFactory;
+
 import io.vertx.core.DeploymentOptions;
 import io.vertx.core.Vertx;
 import io.vertx.core.VertxOptions;
@@ -38,12 +38,15 @@ import io.vertx.core.http.HttpClientOptions;
 /**
  * Created by  on 2017/4/28.
  */
-public abstract class AbstractClientPool implements ClientPool {
+abstract class AbstractClientPool implements ClientPool {
   private static final Logger LOGGER = 
LoggerFactory.getLogger(AbstractClientPool.class);
 
-private ClientPoolManager clientMgr;
+  private HttpClientOptions httpClientOptions;
+
+  private ClientPoolManager clientMgr;
 
-  public AbstractClientPool() {
+  AbstractClientPool(HttpClientOptions httpClientOptions) {
+this.httpClientOptions = httpClientOptions;
 create();
   }
 
@@ -54,22 +57,23 @@ public abstract class AbstractClientPool implements 
ClientPool {
   }
 
   public void create() {
-DynamicIntProperty property = 
DynamicPropertyFactory.getInstance().getIntProperty(ServiceRegistryConfig.EVENT_LOOP_POOL_SIZE,
 4);
-DynamicIntProperty workerPoolSize = 
DynamicPropertyFactory.getInstance().getIntProperty(ServiceRegistryConfig.WORKER_POOL_SIZE,
 4);
+DynamicIntProperty property = DynamicPropertyFactory.getInstance()
+.getIntProperty(ServiceRegistryConfig.EVENT_LOOP_POOL_SIZE, 4);
+DynamicIntProperty workerPoolSize = DynamicPropertyFactory.getInstance()
+.getIntProperty(ServiceRegistryConfig.WORKER_POOL_SIZE, 4);
 
 // 这里面是同步接口,且好像直接在事件线程中用,保险起见,先使用独立的vertx实例
 VertxOptions vertxOptions = new VertxOptions()
-
.setAddressResolverOptions(AddressResolverConfig.getAddressResover(ServiceRegistryConfig.SSL_KEY))
-.setEventLoopPoolSize(property.get());
+
.setAddressResolverOptions(AddressResolverConfig.getAddressResover(ServiceRegistryConfig.SSL_KEY))
+.setEventLoopPoolSize(property.get());
 Vertx vertx = VertxUtils.getOrCreateVertxByName("registry", vertxOptions);
-HttpClientOptions httpClientOptions = createHttpClientOptions();
 clientMgr = new ClientPoolManager<>(vertx, new 
HttpClientPoolFactory(httpClientOptions));
 
 DeploymentOptions deployOptions = 
VertxUtils.createClientDeployOptions(this.clientMgr,
-ServiceRegistryConfig.INSTANCE.getInstances())
-.setWorker(isWorker())
-.setWorkerPoolName(ServiceRegistryConfig.WORKER_POOL_NAME)
-.setWorkerPoolSize(workerPoolSize.get());
+ServiceRegistryConfig.INSTANCE.getInstances())
+.setWorker(isWorker())
+.setWorkerPoolName(ServiceRegistryConfig.WORKER_POOL_NAME)
+.setWorkerPoolSize(workerPoolSize.get());
 try {
   VertxUtils.blockDeploy(vertx, ClientVerticle.class, deployOptions);
 } catch (InterruptedException e) {
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/ClientPool.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/ClientPool.java
index e5db559..3784d98 100644
--- 
a/service-registry/src/main/java/org/ap

[servicecomb-java-chassis] 11/19: [SCB-1691] RegistryUtils manage multiple ServiceRegistry instances

2020-03-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit 7828f7fbe923d42c78cab79d2ab78ed85033f9c0
Author: yhs0092 
AuthorDate: Tue Feb 11 00:17:51 2020 +0800

[SCB-1691] RegistryUtils manage multiple ServiceRegistry instances
---
 .../loadbalance/TestLoadBalanceHandler2.java   |  18 ++--
 .../servicecomb/serviceregistry/RegistryUtils.java | 120 +++--
 .../cache/MicroserviceInstanceCache.java   |   8 +-
 .../serviceregistry/MockMicroserviceVersions.java  |   8 ++
 .../servicecomb/serviceregistry/TestConsumers.java |  17 ---
 .../servicecomb/serviceregistry/TestRegistry.java  |   9 +-
 .../serviceregistry/TestRegistryBase.java  |  24 ++---
 .../cache/TestMicroserviceInstanceCache.java   |  35 --
 .../instance/TestInstanceCacheChecker.java |   2 +-
 .../springboot/common/AbstractDiscoveryClient.java |  26 ++---
 10 files changed, 191 insertions(+), 76 deletions(-)

diff --git 
a/handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/TestLoadBalanceHandler2.java
 
b/handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/TestLoadBalanceHandler2.java
index 2edc5bd..36ee88a 100644
--- 
a/handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/TestLoadBalanceHandler2.java
+++ 
b/handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/TestLoadBalanceHandler2.java
@@ -119,7 +119,7 @@ public class TestLoadBalanceHandler2 {
 Invocation invocation = new Invocation(referenceConfig, operationMeta, new 
HashMap<>());
 
 InstanceCacheManager instanceCacheManager = 
Mockito.mock(InstanceCacheManager.class);
-ServiceRegistry serviceRegistry = Mockito.mock(ServiceRegistry.class);
+ServiceRegistry serviceRegistry = mockUpServiceRegistry();
 TransportManager transportManager = Mockito.mock(TransportManager.class);
 Transport transport = Mockito.mock(Transport.class);
 
ArchaiusUtils.setProperty("servicecomb.loadbalance.filter.operation.enabled", 
"false");
@@ -268,7 +268,7 @@ public class TestLoadBalanceHandler2 {
 Invocation invocation = new Invocation(referenceConfig, operationMeta, new 
HashMap<>());
 
 InstanceCacheManager instanceCacheManager = 
Mockito.mock(InstanceCacheManager.class);
-ServiceRegistry serviceRegistry = Mockito.mock(ServiceRegistry.class);
+ServiceRegistry serviceRegistry = mockUpServiceRegistry();
 TransportManager transportManager = Mockito.mock(TransportManager.class);
 Transport transport = Mockito.mock(Transport.class);
 
ArchaiusUtils.setProperty("servicecomb.loadbalance.filter.operation.enabled", 
"false");
@@ -357,7 +357,7 @@ public class TestLoadBalanceHandler2 {
 Invocation invocation = new Invocation(referenceConfig, operationMeta, new 
HashMap<>());
 
 InstanceCacheManager instanceCacheManager = 
Mockito.mock(InstanceCacheManager.class);
-ServiceRegistry serviceRegistry = Mockito.mock(ServiceRegistry.class);
+ServiceRegistry serviceRegistry = mockUpServiceRegistry();
 TransportManager transportManager = Mockito.mock(TransportManager.class);
 Transport transport = Mockito.mock(Transport.class);
 
ArchaiusUtils.setProperty("servicecomb.loadbalance.filter.operation.enabled", 
"false");
@@ -484,7 +484,7 @@ public class TestLoadBalanceHandler2 {
 });
 
 InstanceCacheManager instanceCacheManager = 
Mockito.mock(InstanceCacheManager.class);
-ServiceRegistry serviceRegistry = Mockito.mock(ServiceRegistry.class);
+ServiceRegistry serviceRegistry = mockUpServiceRegistry();
 TransportManager transportManager = Mockito.mock(TransportManager.class);
 Transport transport = Mockito.mock(Transport.class);
 
ArchaiusUtils.setProperty("servicecomb.loadbalance.filter.operation.enabled", 
"false");
@@ -627,7 +627,7 @@ public class TestLoadBalanceHandler2 {
 });
 
 InstanceCacheManager instanceCacheManager = 
Mockito.mock(InstanceCacheManager.class);
-ServiceRegistry serviceRegistry = Mockito.mock(ServiceRegistry.class);
+ServiceRegistry serviceRegistry = mockUpServiceRegistry();
 TransportManager transportManager = Mockito.mock(TransportManager.class);
 Transport transport = Mockito.mock(Transport.class);
 
ArchaiusUtils.setProperty("servicecomb.loadbalance.filter.operation.enabled", 
"false");
@@ -778,7 +778,7 @@ public class TestLoadBalanceHandler2 {
 AsyncResponse asyncResp = Mockito.mock(AsyncResponse.class);
 
 InstanceCacheManager instanceCacheManager = 
Mockito.mock(InstanceCacheManager.class);
-ServiceRegistry serviceRegistry = Mockito.mock(ServiceRegistry.class);
+ServiceRegistry serviceRegistry = mockUpServiceRegistry();
 TransportMa

[servicecomb-java-chassis] 09/19: [SCB-1691] add ServiceRegistryCache

2020-03-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit e5d89b5e64bfe6f85199efcb3f7a3d452e50c14e
Author: yhs0092 
AuthorDate: Sat Jan 18 15:17:42 2020 +0800

[SCB-1691] add ServiceRegistryCache
---
 .../serviceregistry/ServiceRegistry.java   |   4 +
 .../registry/AbstractServiceRegistry.java  |   8 +
 .../registry/cache/AggregateMicroserviceCache.java | 139 
 .../cache/AggregateServiceRegistryCache.java   |  99 ++
 .../registry/cache/MicroserviceCache.java  |  68 
 .../registry/cache/MicroserviceCacheKey.java   | 122 +++
 .../cache/MicroserviceCacheRefreshedEvent.java |  32 ++
 .../cache/RefreshableMicroserviceCache.java| 248 ++
 .../cache/RefreshableServiceRegistryCache.java | 175 ++
 .../registry/cache/ServiceRegistryCache.java   |  30 ++
 .../registry/EmptyMockServiceRegistry.java | 139 
 .../cache/AggregateMicroserviceCacheTest.java  | 159 +
 .../cache/AggregateServiceRegistryCacheTest.java   | 212 
 .../registry/cache/MicroserviceCacheKeyTest.java   |  88 +
 .../registry/cache/MockedMicroserviceCache.java|  49 +++
 .../cache/RefreshableMicroserviceCacheTest.java| 367 +
 .../cache/RefreshableServiceRegistryCacheTest.java | 205 
 17 files changed, 2144 insertions(+)

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/ServiceRegistry.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/ServiceRegistry.java
index 0e6e1a2..2de3e83 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/ServiceRegistry.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/ServiceRegistry.java
@@ -25,6 +25,8 @@ import 
org.apache.servicecomb.serviceregistry.api.registry.Microservice;
 import 
org.apache.servicecomb.serviceregistry.api.registry.MicroserviceInstance;
 import org.apache.servicecomb.serviceregistry.client.ServiceRegistryClient;
 import 
org.apache.servicecomb.serviceregistry.client.http.MicroserviceInstances;
+import org.apache.servicecomb.serviceregistry.registry.cache.MicroserviceCache;
+import 
org.apache.servicecomb.serviceregistry.registry.cache.MicroserviceCacheKey;
 
 import com.google.common.eventbus.EventBus;
 
@@ -72,6 +74,8 @@ public interface ServiceRegistry {
   MicroserviceInstances findServiceInstances(String appId, String 
microserviceName,
   String microserviceVersionRule, String revision);
 
+  MicroserviceCache findMicroserviceCache(MicroserviceCacheKey 
microserviceCacheKey);
+
   boolean updateMicroserviceProperties(Map properties);
 
   /**
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/AbstractServiceRegistry.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/AbstractServiceRegistry.java
index baf25dc..a37fdbc 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/AbstractServiceRegistry.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/AbstractServiceRegistry.java
@@ -46,6 +46,8 @@ import 
org.apache.servicecomb.serviceregistry.consumer.MicroserviceManager;
 import 
org.apache.servicecomb.serviceregistry.consumer.StaticMicroserviceVersions;
 import 
org.apache.servicecomb.serviceregistry.definition.MicroserviceDefinition;
 import 
org.apache.servicecomb.serviceregistry.definition.MicroserviceNameParser;
+import org.apache.servicecomb.serviceregistry.registry.cache.MicroserviceCache;
+import 
org.apache.servicecomb.serviceregistry.registry.cache.MicroserviceCacheKey;
 import 
org.apache.servicecomb.serviceregistry.task.MicroserviceServiceCenterTask;
 import org.apache.servicecomb.serviceregistry.task.ServiceCenterTask;
 import org.apache.servicecomb.serviceregistry.task.event.RecoveryEvent;
@@ -246,6 +248,12 @@ public abstract class AbstractServiceRegistry implements 
ServiceRegistry {
   }
 
   @Override
+  public MicroserviceCache findMicroserviceCache(MicroserviceCacheKey 
microserviceCacheKey) {
+// TODO find MicroserviceCache from ServiceRegistryCache
+return null;
+  }
+
+  @Override
   public boolean updateMicroserviceProperties(Map properties) {
 boolean success = 
srClient.updateMicroserviceProperties(microservice.getServiceId(),
 properties);
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/cache/AggregateMicroserviceCache.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/cache/AggregateMicroserviceCache.java
new file mode 100644
index 000..a0082f7
--- /dev/null
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/cache

[servicecomb-java-chassis] 02/19: [SCB-1691] Decouple the ServiceRegistry and other modules

2020-03-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit d6cbf86cc4d3b9d854456a393fd3c2965e43eb17
Author: yhs0092 
AuthorDate: Wed Feb 5 15:23:57 2020 +0800

[SCB-1691] Decouple the ServiceRegistry and other modules

- DiscoveryTree get InstanceCacheManager from RegistryUtils directly
- SwaggerLoader don't rely on ServiceRegistry directly
- AppManager does not refer to ServiceRegistry directly
- ServiceRegistry does not hold AppManager
- ServiceRegistry does not hold InstanceCacheManager
- ServiceRegistryFactory doesn't hold the instance of ServiceRegistry
- SCBEngine doesn't hold ServiceRegistry instance directly
---
 .../org/apache/servicecomb/core/SCBEngine.java | 22 +---
 .../consumer/MicroserviceReferenceConfig.java  |  2 +-
 .../handler/impl/TestSimpleLoadBalanceHandler.java |  5 +--
 .../servicecomb/demo/edge/consumer/Consumer.java   |  2 +-
 .../jaxrs/client/MultiErrorCodeServiceClient.java  |  2 +-
 .../loadbalance/TestLoadBalanceHandler2.java   | 21 +++
 .../loadbalance/TestLoadbalanceHandler.java|  3 +-
 .../java/org/apache/servicecomb/it/ITUtils.java|  4 +--
 .../servicecomb/it/deploy/MicroserviceDeploy.java  |  2 +-
 .../it/extend/engine/GateRestTemplate.java |  2 +-
 .../it/extend/engine/ITSCBAsyncRestTemplate.java   |  4 +--
 .../it/extend/engine/ITSCBRestTemplate.java|  2 +-
 .../servicecomb/it/edge/PreLoadBootListener.java   |  2 +-
 .../async/CseAsyncClientHttpRequestTest.java   |  7 +++-
 .../servicecomb/serviceregistry/RegistryUtils.java | 33 ++---
 .../serviceregistry/ServiceRegistry.java   | 20 +--
 .../serviceregistry/consumer/AppManager.java   | 14 ++--
 .../consumer/MicroserviceVersion.java  |  6 ++--
 .../consumer/MicroserviceVersions.java |  5 +--
 .../consumer/StaticMicroserviceVersions.java   |  5 +--
 .../diagnosis/instance/InstanceCacheCheckTask.java |  3 +-
 .../serviceregistry/discovery/DiscoveryTree.java   |  1 -
 .../registry/AbstractServiceRegistry.java  | 42 +-
 .../registry/RemoteServiceRegistry.java|  3 +-
 .../registry/ServiceRegistryFactory.java   | 20 ---
 .../serviceregistry/swagger/SwaggerLoader.java | 17 -
 .../serviceregistry/MockMicroserviceVersions.java  |  9 ++---
 .../servicecomb/serviceregistry/TestConsumers.java |  4 +--
 .../servicecomb/serviceregistry/TestRegistry.java  |  1 -
 .../serviceregistry/TestRegistryBase.java  | 14 
 .../instance/TestInstanceCacheChecker.java | 18 ++
 .../discovery/TestDiscoveryTree.java   | 17 +++--
 .../registry/TestServiceRegistryFactory.java   |  8 ++---
 .../serviceregistry/swagger/TestSwaggerLoader.java | 35 +-
 34 files changed, 166 insertions(+), 189 deletions(-)

diff --git a/core/src/main/java/org/apache/servicecomb/core/SCBEngine.java 
b/core/src/main/java/org/apache/servicecomb/core/SCBEngine.java
index 915610b..e704efe 100644
--- a/core/src/main/java/org/apache/servicecomb/core/SCBEngine.java
+++ b/core/src/main/java/org/apache/servicecomb/core/SCBEngine.java
@@ -103,8 +103,6 @@ public class SCBEngine {
 
   private volatile SCBStatus status = SCBStatus.DOWN;
 
-  private ServiceRegistry serviceRegistry;
-
   private EventBus eventBus;
 
   private ExecutorManager executorManager = new ExecutorManager();
@@ -123,8 +121,7 @@ public class SCBEngine {
   private Thread shutdownHook;
 
   protected SCBEngine() {
-serviceRegistry = RegistryUtils.getServiceRegistry();
-eventBus = serviceRegistry.getEventBus();
+eventBus = EventManager.getEventBus();
 
 // see SCB-1266, fix Log4j2 leak marker problem
 LogMarkerLeakFixUtils.fix();
@@ -142,7 +139,7 @@ public class SCBEngine {
   }
 
   public String getAppId() {
-return serviceRegistry.getAppId();
+return RegistryUtils.getAppId();
   }
 
   public void setStatus(SCBStatus status) {
@@ -165,11 +162,11 @@ public class SCBEngine {
   }
 
   public ServiceRegistry getServiceRegistry() {
-return serviceRegistry;
+return RegistryUtils.getServiceRegistry();
   }
 
   public SwaggerLoader getSwaggerLoader() {
-return serviceRegistry.getSwaggerLoader();
+return RegistryUtils.getSwaggerLoader();
   }
 
   public ConsumerHandlerManager getConsumerHandlerManager() {
@@ -324,13 +321,12 @@ public class SCBEngine {
 LOGGER.info(serviceInfo.toString());
   }
 
-
   private void doRun() throws Exception {
 status = SCBStatus.STARTING;
 
 bootListeners.sort(Comparator.comparingInt(BootListener::getOrder));
 
-AbstractEndpointsCache.init(serviceRegistry.getInstanceCacheManager(), 
transportManager);
+AbstractEndpointsCache.init(RegistryUtils.getInstanceCacheManager(), 
transportManager

[servicecomb-java-chassis] 01/19: [SCB-1691] modify instance status change interface

2020-03-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit 0b507b459e0a512e74e368e19063a3c23196b16e
Author: yhs0092 
AuthorDate: Sat Dec 28 17:51:43 2019 +0800

[SCB-1691] modify instance status change interface
---
 .../client/LocalServiceRegistryClientImpl.java |  30 +++---
 .../client/ServiceRegistryClient.java  |  23 -
 .../client/http/ServiceRegistryClientImpl.java |  34 +++
 .../client/LocalServiceRegistryClientImplTest.java |  66 ++
 .../client/http/TestServiceRegistryClientImpl.java | 101 -
 5 files changed, 199 insertions(+), 55 deletions(-)

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImpl.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImpl.java
index 4b1b6a6..cf8963f 100755
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImpl.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImpl.java
@@ -434,30 +434,26 @@ public class LocalServiceRegistryClientImpl implements 
ServiceRegistryClient {
   }
 
   @Override
-  public boolean undateMicroserviceInstanceStatus(String microserviceId, 
String microserviceInstanceId, String status) {
+  public boolean updateMicroserviceInstanceStatus(String microserviceId, 
String instanceId,
+  MicroserviceInstanceStatus status) {
+if (null == status) {
+  throw new IllegalArgumentException("null status is now allowed");
+}
+
 Map instanceMap = 
microserviceInstanceMap.get(microserviceId);
 if (instanceMap == null) {
   throw new IllegalArgumentException("Invalid serviceId, serviceId=" + 
microserviceId);
 }
 
-MicroserviceInstance microserviceInstance = 
instanceMap.get(microserviceInstanceId);
+MicroserviceInstance microserviceInstance = instanceMap.get(instanceId);
 if (microserviceInstance == null) {
   throw new IllegalArgumentException(
-  String.format("Invalid argument. microserviceId=%s, 
microserviceInstanceId=%s.",
-  microserviceId,
-  microserviceInstanceId));
-}
-MicroserviceInstanceStatus instanceStatus;
-try {
-  instanceStatus = MicroserviceInstanceStatus.valueOf(status);
-}
-catch (IllegalArgumentException e){
-  throw new IllegalArgumentException("Invalid status.");
-}
-if (null != instanceStatus) {
-  microserviceInstance.setStatus(instanceStatus);
-  return true;
+  String.format("Invalid argument. microserviceId=%s, instanceId=%s.",
+  microserviceId,
+  instanceId));
 }
-return false;
+
+microserviceInstance.setStatus(status);
+return true;
   }
 }
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/ServiceRegistryClient.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/ServiceRegistryClient.java
index 81f61bf..b093c0c 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/ServiceRegistryClient.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/ServiceRegistryClient.java
@@ -179,6 +179,27 @@ public interface ServiceRegistryClient {
* @param microserviceId
* @param microserviceInstanceId
* @return
+   * @deprecated use {@link #updateMicroserviceInstanceStatus(String, String, 
MicroserviceInstanceStatus)} instead
*/
-  boolean undateMicroserviceInstanceStatus(String microserviceId, String 
microserviceInstanceId, String status);
+  @Deprecated
+  default boolean undateMicroserviceInstanceStatus(String microserviceId, 
String microserviceInstanceId,
+  String status) {
+MicroserviceInstanceStatus instanceStatus;
+try {
+  instanceStatus = MicroserviceInstanceStatus.valueOf(status);
+} catch (IllegalArgumentException e) {
+  throw new IllegalArgumentException("Invalid status: " + status);
+}
+
+return updateMicroserviceInstanceStatus(microserviceId, 
microserviceInstanceId, instanceStatus);
+  }
+
+  /**
+   * Update the instance status registered in service center.
+   * @param microserviceId the microserviceId of the instance
+   * @param instanceId the instanceId of the instance
+   * @param status update to this status
+   * @return whether this operation success
+   */
+  boolean updateMicroserviceInstanceStatus(String microserviceId, String 
instanceId, MicroserviceInstanceStatus status);
 }
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/ServiceRegistryClientImpl.java
 
b/service-registry/src/

[servicecomb-java-chassis] branch master updated (0e59111 -> 1793757)

2020-02-05 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


from 0e59111  [SCB-1623]when timeout, return 408 error code and message is 
timeout
 add 1793757  [SCB-1625]update license for spring components

No new revisions were added by this update.

Summary of changes:
 LICENSE   |   9 +-
 java-chassis-distribution/src/release/LICENSE | 133 +-
 2 files changed, 70 insertions(+), 72 deletions(-)



[servicecomb-java-chassis] branch master updated (d820be9 -> 6d40af0)

2019-11-18 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


from d820be9  [SCB-1582] Upgrading thirdParty dependency versions
 add 6d40af0  [SCB-1582] Update thirdparty dependency versions and delete 
unused dependencies

No new revisions were added by this update.

Summary of changes:
 java-chassis-dependencies/default/pom.xml| 20 +++-
 .../response/TestJaxrsConsumerResponseMapper.java|  6 +-
 2 files changed, 16 insertions(+), 10 deletions(-)



[servicecomb-java-chassis] branch master updated (b581ced -> d820be9)

2019-11-15 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


from b581ced  [SCB-1592]upgrade vert.x and netty.(4)update license and fix 
conflicts
 add d820be9  [SCB-1582] Upgrading thirdParty dependency versions

No new revisions were added by this update.

Summary of changes:
 java-chassis-dependencies/default/pom.xml | 28 ++-
 java-chassis-distribution/src/release/LICENSE | 12 ++--
 2 files changed, 33 insertions(+), 7 deletions(-)



[servicecomb-java-chassis] 02/04: [SCB-1592]upgrade vert.x and netty.(2)fixed interface change

2019-11-15 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit bfa60c1fc2b1899b38bdae31e91ead7fdeaa841f
Author: liubao 
AuthorDate: Fri Nov 15 11:23:56 2019 +0800

[SCB-1592]upgrade vert.x and netty.(2)fixed interface change
---
 .../demo/edge/service/EdgeDispatcher.java  |  3 +-
 .../service/encrypt/EncryptEdgeDispatcher.java |  3 +-
 .../config/client/ConfigCenterClient.java  | 44 +++--
 .../edge/core/DefaultEdgeDispatcher.java   |  3 +-
 .../edge/core/URLMappedEdgeDispatcher.java |  7 ++--
 .../apache/servicecomb/it/edge/EdgeDispatcher.java |  3 +-
 .../it/edge/encrypt/EncryptEdgeDispatcher.java |  3 +-
 .../metrics/core/TestVertxMetersInitializer.java   |  2 +
 .../client/http/WebsocketUtils.java| 46 +++---
 .../transport/highway/HighwayServerVerticle.java   |  4 +-
 .../core/http/impl/Http1xConnectionBaseEx.java |  2 +-
 .../rest/client/http/TestRestClientInvocation.java |  3 +-
 .../transport/rest/vertx/RestServerVerticle.java   |  4 ++
 .../transport/rest/vertx/VertxRestDispatcher.java  |  3 +-
 .../vertx/accesslog/element/impl/CookieItem.java   | 10 ++---
 .../rest/vertx/TestRestServerVerticle.java |  2 +
 .../accesslog/element/impl/CookieItemTest.java | 22 +--
 .../vertx/accesslog/impl/AccessLogHandlerTest.java | 10 ++---
 18 files changed, 91 insertions(+), 83 deletions(-)

diff --git 
a/demo/demo-edge/edge-service/src/main/java/org/apache/servicecomb/demo/edge/service/EdgeDispatcher.java
 
b/demo/demo-edge/edge-service/src/main/java/org/apache/servicecomb/demo/edge/service/EdgeDispatcher.java
index d5643d3..0eef0ba 100644
--- 
a/demo/demo-edge/edge-service/src/main/java/org/apache/servicecomb/demo/edge/service/EdgeDispatcher.java
+++ 
b/demo/demo-edge/edge-service/src/main/java/org/apache/servicecomb/demo/edge/service/EdgeDispatcher.java
@@ -25,7 +25,6 @@ import org.apache.servicecomb.edge.core.EdgeInvocation;
 
 import io.vertx.ext.web.Router;
 import io.vertx.ext.web.RoutingContext;
-import io.vertx.ext.web.handler.CookieHandler;
 
 public class EdgeDispatcher extends AbstractEdgeDispatcher {
   private CompatiblePathVersionMapper versionMapper = new 
CompatiblePathVersionMapper();
@@ -38,7 +37,7 @@ public class EdgeDispatcher extends AbstractEdgeDispatcher {
   @Override
   public void init(Router router) {
 String regex = "/api/([^/]+)/([^/]+)/(.*)";
-router.routeWithRegex(regex).handler(CookieHandler.create());
+// cookies handler are enabled by default start from 3.8.3
 router.routeWithRegex(regex).handler(createBodyHandler());
 
router.routeWithRegex(regex).failureHandler(this::onFailure).handler(this::onRequest);
   }
diff --git 
a/demo/demo-edge/edge-service/src/main/java/org/apache/servicecomb/demo/edge/service/encrypt/EncryptEdgeDispatcher.java
 
b/demo/demo-edge/edge-service/src/main/java/org/apache/servicecomb/demo/edge/service/encrypt/EncryptEdgeDispatcher.java
index 5c8a9a5..c4900a6 100644
--- 
a/demo/demo-edge/edge-service/src/main/java/org/apache/servicecomb/demo/edge/service/encrypt/EncryptEdgeDispatcher.java
+++ 
b/demo/demo-edge/edge-service/src/main/java/org/apache/servicecomb/demo/edge/service/encrypt/EncryptEdgeDispatcher.java
@@ -30,7 +30,6 @@ import org.slf4j.LoggerFactory;
 import io.vertx.core.http.HttpServerRequest;
 import io.vertx.ext.web.Router;
 import io.vertx.ext.web.RoutingContext;
-import io.vertx.ext.web.handler.CookieHandler;
 
 public class EncryptEdgeDispatcher extends AbstractEdgeDispatcher {
   private static final Logger LOGGER = 
LoggerFactory.getLogger(EncryptEdgeDispatcher.class);
@@ -50,7 +49,7 @@ public class EncryptEdgeDispatcher extends 
AbstractEdgeDispatcher {
   public void init(Router router) {
 {
   String regex = "/" + prefix + "/([^/]+)/([^/]+)/(.*)";
-  router.routeWithRegex(regex).handler(CookieHandler.create());
+  // cookies handler are enabled by default start from 3.8.3
   router.routeWithRegex(regex).handler(createBodyHandler());
   
router.routeWithRegex(regex).failureHandler(this::onFailure).handler(this::onRequest);
 }
diff --git 
a/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
 
b/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
index ac0f88a..8ad91bd 100644
--- 
a/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
+++ 
b/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
@@ -70,6 +70,7 @@ import io.vertx.core.http.CaseInsensitiveHeaders;
 import io.vertx.core.http.HttpClientOptions;
 import io.vertx.core.http.HttpClientRequest;
 import io.vertx.core.http.WebSocket;
+import io.vertx.cor

[servicecomb-java-chassis] 04/04: [SCB-1592]upgrade vert.x and netty.(4)update license and fix conflicts

2019-11-15 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit b581ced963cbc094eaea1bb5d5ec002e183b45f7
Author: liubao 
AuthorDate: Fri Nov 15 16:06:08 2019 +0800

[SCB-1592]upgrade vert.x and netty.(4)update license and fix conflicts
---
 java-chassis-dependencies/default/pom.xml |  4 +--
 java-chassis-distribution/src/release/LICENSE | 41 +--
 2 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/java-chassis-dependencies/default/pom.xml 
b/java-chassis-dependencies/default/pom.xml
index ac2f22c..5536307 100644
--- a/java-chassis-dependencies/default/pom.xml
+++ b/java-chassis-dependencies/default/pom.xml
@@ -82,7 +82,7 @@
 3.10.4
 5.3.2.Final
 0.3.0
-4.1.31.Final
+4.1.43.Final
 3.14.2
 1.6.2
 0.6.0
@@ -105,7 +105,7 @@
 2.0.26.Final
 0.10
 2.6.0
-3.6.3
+3.8.3
 1.4.11.1
 2.9.3
 2.7.13
diff --git a/java-chassis-distribution/src/release/LICENSE 
b/java-chassis-distribution/src/release/LICENSE
index 9a0d073..a4f65dd 100755
--- a/java-chassis-distribution/src/release/LICENSE
+++ b/java-chassis-distribution/src/release/LICENSE
@@ -242,9 +242,7 @@ You can find a copy of the License at 
licenses/LICENSE-epl-v20
 * JRuby Core (org.jruby:jruby-core:9.2.6.0 - 
https://github.com/jruby/jruby/jruby-core)
 * JRuby Lib Setup (org.jruby:jruby-stdlib:9.2.6.0 - 
https://github.com/jruby/jruby/jruby-stdlib)
 * JRuby Main Maven Artifact (org.jruby:jruby:9.2.6.0 - 
https://github.com/jruby/jruby/jruby-artifacts/jruby)
-* Vert.x Core (io.vertx:vertx-core:3.6.3 - 
http://nexus.sonatype.org/oss-repository-hosting.html/vertx-parent/vertx-core)
-* vertx-web (io.vertx:vertx-web:3.6.3 - 
http://nexus.sonatype.org/oss-repository-hosting.html/vertx-parent/vertx-ext/vertx-ext-parent/vertx-web-parent/vertx-web)
-
+* Vert.x Core (io.vertx:vertx-core:3.8.3 - 
https://github.com/eclipse-vertx/vert.x)
 
 
 This product bundles libraries which are licensed under the
@@ -517,21 +515,21 @@ For details, see their respective project links.
 * nailgun-server (com.martiansoftware:nailgun-server:0.9.1 - 
http://martiansoftware.com/nailgun)
 * netflix-commons-util (com.netflix.netflix-commons:netflix-commons-util:0.1.1 
- https://github.com/Netflix/netflix-commons)
 * netflix-statistics (com.netflix.netflix-commons:netflix-statistics:0.1.1 - 
https://github.com/Netflix/netflix-commons)
-* Netty/Buffer (io.netty:netty-buffer:4.1.28.Final - 
http://netty.io/netty-buffer/)
-* Netty/Codec/DNS (io.netty:netty-codec-dns:4.1.28.Final - 
http://netty.io/netty-codec-dns/)
-* Netty/Codec/HTTP (io.netty:netty-codec-http:4.1.28.Final - 
http://netty.io/netty-codec-http/)
-* Netty/Codec/HTTP2 (io.netty:netty-codec-http2:4.1.28.Final - 
http://netty.io/netty-codec-http2/)
-* Netty/Codec/Socks (io.netty:netty-codec-socks:4.1.28.Final - 
http://netty.io/netty-codec-socks/)
-* Netty/Codec (io.netty:netty-codec:4.1.28.Final - 
http://netty.io/netty-codec/)
-* Netty/Common (io.netty:netty-common:4.1.28.Final - 
http://netty.io/netty-common/)
-* Netty/Handler/Proxy (io.netty:netty-handler-proxy:4.1.28.Final - 
http://netty.io/netty-handler-proxy/)
-* Netty/Handler (io.netty:netty-handler:4.1.28.Final - 
http://netty.io/netty-handler/)
-* Netty/Resolver/DNS (io.netty:netty-resolver-dns:4.1.28.Final - 
http://netty.io/netty-resolver-dns/)
-* Netty/Resolver (io.netty:netty-resolver:4.1.28.Final - 
http://netty.io/netty-resolver/)
-* Netty/TomcatNative [BoringSSL - Static] 
(io.netty:netty-tcnative-boringssl-static:2.0.14.Final - 
https://github.com/netty/netty-tcnative/netty-tcnative-boringssl-static/)
-* Netty/Transport/Native/Epoll 
(io.netty:netty-transport-native-epoll:4.1.32.Final - 
http://netty.io/netty-transport-native-epoll/)
-* Netty/Transport/Native/Unix/Common 
(io.netty:netty-transport-native-unix-common:4.1.32.Final - 
http://netty.io/netty-transport-native-unix-common/)
-* Netty/Transport (io.netty:netty-transport:4.1.28.Final - 
http://netty.io/netty-transport/)
+* Netty/Buffer (io.netty:netty-buffer:4.1.43.Final - 
http://netty.io/netty-buffer/)
+* Netty/Codec/DNS (io.netty:netty-codec-dns:4.1.43.Final - 
http://netty.io/netty-codec-dns/)
+* Netty/Codec/HTTP (io.netty:netty-codec-http:4.1.43.Final - 
http://netty.io/netty-codec-http/)
+* Netty/Codec/HTTP2 (io.netty:netty-codec-http2:4.1.43.Final - 
http://netty.io/netty-codec-http2/)
+* Netty/Codec/Socks (io.netty:netty-codec-socks:4.1.43.Final - 
http://netty.io/netty-codec-socks/)
+* Netty/Codec (io.netty:netty-codec:4.1.43.Final - 
http://netty.io/netty-codec/)
+* Netty/Common (io.netty:netty-common:4.1.43.Final - 
http://netty.io/netty-common/)
+* Netty/Handler/Proxy (io.netty:netty-handler-proxy:4.1.43.Final - 
http://netty.io/netty-handler-proxy/)
+* Netty/Handler (io.netty:netty-handler:4.1.43

[servicecomb-java-chassis] 03/04: [SCB-1592]upgrade vert.x and netty.(3)fixed testing failures and upgrade tcnetty

2019-11-15 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit d1e493f57f222004dad15f58d17fbdc4e45c2cea
Author: liubao 
AuthorDate: Fri Nov 15 15:36:09 2019 +0800

[SCB-1592]upgrade vert.x and netty.(3)fixed testing failures and upgrade 
tcnetty
---
 .../org/apache/servicecomb/edge/core/TestEdgeInvocation.java   | 10 ++
 java-chassis-dependencies/default/pom.xml  |  2 +-
 scripts/travis.sh  |  2 +-
 .../transport/rest/vertx/TestVertxRestDispatcher.java  | 10 +-
 4 files changed, 21 insertions(+), 3 deletions(-)

diff --git 
a/edge/edge-core/src/test/java/org/apache/servicecomb/edge/core/TestEdgeInvocation.java
 
b/edge/edge-core/src/test/java/org/apache/servicecomb/edge/core/TestEdgeInvocation.java
index 8995cbd..177c44c 100644
--- 
a/edge/edge-core/src/test/java/org/apache/servicecomb/edge/core/TestEdgeInvocation.java
+++ 
b/edge/edge-core/src/test/java/org/apache/servicecomb/edge/core/TestEdgeInvocation.java
@@ -50,6 +50,7 @@ import org.junit.Test;
 import org.junit.rules.ExpectedException;
 
 import io.vertx.core.Context;
+import io.vertx.core.Vertx;
 import io.vertx.core.impl.VertxImpl;
 import io.vertx.ext.web.RoutingContext;
 import mockit.Deencapsulation;
@@ -61,6 +62,8 @@ import mockit.Mocked;
 public class TestEdgeInvocation {
   String microserviceName = "ms";
 
+  @Mocked Vertx vertx;
+
   @Mocked
   RoutingContext routingContext;
 
@@ -87,6 +90,13 @@ public class TestEdgeInvocation {
 
   @Before
   public void setup() {
+new Expectations() {
+  {
+Vertx.currentContext();
+result = context;
+  }
+};
+
 referenceConfig.setMicroserviceVersionRule(microserviceVersionRule);
 referenceConfig.setTransport("rest");
 
diff --git a/java-chassis-dependencies/default/pom.xml 
b/java-chassis-dependencies/default/pom.xml
index 2d78a4f..ac2f22c 100644
--- a/java-chassis-dependencies/default/pom.xml
+++ b/java-chassis-dependencies/default/pom.xml
@@ -102,7 +102,7 @@
 Edgware.SR3 
 1.5.22
 1.3.3
-2.0.22.Final
+2.0.26.Final
 0.10
 2.6.0
 3.6.3
diff --git a/scripts/travis.sh b/scripts/travis.sh
index 3d14395..7ce9978 100755
--- a/scripts/travis.sh
+++ b/scripts/travis.sh
@@ -31,7 +31,7 @@ if [ "$1" == "install" ]; then
 if [ "$TAGGEDCOMMIT" == "true" ]; then
 echo "Skipping the installation as it is tagged commit"
 else
-mvn apache-rat:check 
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
 -B -Pit,samples,distribution
+mvn apache-rat:check 
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
 -B -Pit,distribution
 if [ $? != 0 ]; then
 echo "${red}Rat check failed.${reset}"
 exit 1
diff --git 
a/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/TestVertxRestDispatcher.java
 
b/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/TestVertxRestDispatcher.java
index 2d8185c..b6e1861 100644
--- 
a/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/TestVertxRestDispatcher.java
+++ 
b/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/TestVertxRestDispatcher.java
@@ -47,6 +47,7 @@ import io.vertx.core.AsyncResult;
 import io.vertx.core.Context;
 import io.vertx.core.Handler;
 import io.vertx.core.MultiMap;
+import io.vertx.core.Vertx;
 import io.vertx.core.buffer.Buffer;
 import io.vertx.core.http.Cookie;
 import io.vertx.core.http.HttpMethod;
@@ -278,7 +279,7 @@ public class TestVertxRestDispatcher {
   }
 
   @Test
-  public void onRequest(@Mocked Context context, @Mocked HttpServerRequest 
request,
+  public void onRequest(@Mocked Vertx vertx, @Mocked Context context, @Mocked 
HttpServerRequest request,
   @Mocked SocketAddress socketAdrress) {
 Map map = new HashMap<>();
 RoutingContext routingContext = new MockUp() {
@@ -294,6 +295,13 @@ public class TestVertxRestDispatcher {
   }
 }.getMockInstance();
 
+new Expectations() {
+  {
+Vertx.currentContext();
+result = context;
+  }
+};
+
 Deencapsulation.invoke(dispatcher, "onRequest", routingContext);
 
 Assert.assertEquals(VertxRestInvocation.class, 
map.get(RestConst.REST_PRODUCER_INVOCATION).getClass());



[servicecomb-java-chassis] 01/04: [SCB-1592]upgrade vert.x and netty.(1)update pom and fix compile errors

2019-11-15 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit 77cf5df1f22b0fe8de69ba24dbc5381171fa6b0c
Author: liubao 
AuthorDate: Fri Nov 15 09:24:30 2019 +0800

[SCB-1592]upgrade vert.x and netty.(1)update pom and fix compile errors
---
 .../servicecomb/edge/core/TestEdgeInvocation.java  |7 -
 .../main/java/io/vertx/core/impl/SyncContext.java  |   28 +-
 .../main/java/io/vertx/core/impl/SyncVertx.java|   53 -
 .../main/java/io/vertx/core/impl/VertxImpl.java| 1137 
 .../main/java/io/vertx/core/impl/VertxImpl.java| 1118 ---
 .../vertx/ext/web/impl/HttpServerRequestUtils.java |   26 -
 .../VertxServerRequestToHttpServletRequest.java|4 +-
 .../vertx/stream/InputStreamToReadStream.java  |3 +-
 .../vertx/stream/OutputStreamToWriteStream.java|   25 +-
 .../ext/web/impl/TestHttpServerRequestUtils.java   |8 -
 .../foundation/vertx/TestVertxUtils.java   |6 +-
 .../vertx/client/TestClientPoolManager.java|   20 +-
 .../vertx/client/tcp/TestTcpClientConnection.java  |1 +
 .../foundation/vertx/http/TestReadStreamPart.java  |   10 +-
 ...TestVertxServerRequestToHttpServletRequest.java |   11 +-
 ...stVertxServerResponseToHttpServletResponse.java |   17 +-
 .../foundation/vertx/stream/TestPumpFromPart.java  |4 +-
 .../rest/vertx/TestVertxRestDispatcher.java|   53 +-
 18 files changed, 122 insertions(+), 2409 deletions(-)

diff --git 
a/edge/edge-core/src/test/java/org/apache/servicecomb/edge/core/TestEdgeInvocation.java
 
b/edge/edge-core/src/test/java/org/apache/servicecomb/edge/core/TestEdgeInvocation.java
index a566085..8995cbd 100644
--- 
a/edge/edge-core/src/test/java/org/apache/servicecomb/edge/core/TestEdgeInvocation.java
+++ 
b/edge/edge-core/src/test/java/org/apache/servicecomb/edge/core/TestEdgeInvocation.java
@@ -87,13 +87,6 @@ public class TestEdgeInvocation {
 
   @Before
   public void setup() {
-new Expectations(VertxImpl.class) {
-  {
-VertxImpl.context();
-result = context;
-  }
-};
-
 referenceConfig.setMicroserviceVersionRule(microserviceVersionRule);
 referenceConfig.setTransport("rest");
 
diff --git 
a/foundations/foundation-test-scaffolding/src/main/java/io/vertx/core/impl/SyncContext.java
 
b/foundations/foundation-test-scaffolding/src/main/java/io/vertx/core/impl/SyncContext.java
index 4fd3369..0640b48 100644
--- 
a/foundations/foundation-test-scaffolding/src/main/java/io/vertx/core/impl/SyncContext.java
+++ 
b/foundations/foundation-test-scaffolding/src/main/java/io/vertx/core/impl/SyncContext.java
@@ -19,20 +19,28 @@ package io.vertx.core.impl;
 import java.util.concurrent.Executor;
 
 import io.vertx.core.AsyncResult;
-import io.vertx.core.Future;
 import io.vertx.core.Handler;
+import io.vertx.core.Promise;
+import io.vertx.core.Vertx;
 import io.vertx.core.spi.metrics.PoolMetrics;
 
 public class SyncContext extends EventLoopContext {
+  protected VertxInternal owner;
+
   public SyncContext() {
 this(null);
   }
 
   public SyncContext(VertxInternal vertx) {
 super(vertx, null, null, null, null, null, null);
-if (SyncVertx.class.isInstance(vertx)) {
-  ((SyncVertx) vertx).setContext(this);
-}
+  }
+
+  public VertxInternal owner() {
+return owner;
+  }
+
+  public void setOwner(VertxInternal owner) {
+this.owner = owner;
   }
 
   @Override
@@ -40,9 +48,9 @@ public class SyncContext extends EventLoopContext {
 task.handle(null);
   }
 
-  public static  void syncExecuteBlocking(Handler> 
blockingCodeHandler,
+  public static  void syncExecuteBlocking(Handler> 
blockingCodeHandler,
   Handler> asyncResultHandler) {
-Future res = Future.future();
+Promise res = Promise.promise();
 
 try {
   blockingCodeHandler.handle(res);
@@ -51,11 +59,11 @@ public class SyncContext extends EventLoopContext {
   return;
 }
 
-res.setHandler(asyncResultHandler);
+res.future().setHandler(asyncResultHandler);
   }
 
   @Override
-  public  void executeBlockingInternal(Handler> action, 
Handler> resultHandler) {
+  public  void executeBlockingInternal(Handler> action, 
Handler> resultHandler) {
 syncExecuteBlocking((future) -> {
   try {
 action.handle(future);
@@ -66,13 +74,13 @@ public class SyncContext extends EventLoopContext {
   }
 
   @Override
-  public  void executeBlocking(Handler> blockingCodeHandler, 
boolean ordered,
+  public  void executeBlocking(Handler> blockingCodeHandler, 
boolean ordered,
   Handler> asyncResultHandler) {
 syncExecuteBlocking(blockingCodeHandler, asyncResultHandler);
   }
 
   @Override
-   void executeBlocking(Handler> blockingCodeHandler,
+   void executeBlocking(Handler> blockingCodeHandler,
   Handler> resultHandler,
   Executo

[servicecomb-java-chassis] branch master updated (a91284e -> 31a1263)

2019-11-06 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


from a91284e  fix wrong code for sample
 add 31a1263  [SCB-1566]add README.md for 中文

No new revisions were added by this update.

Summary of changes:
 README.md|   2 +-
 README_ZH.md | 139 +++
 2 files changed, 140 insertions(+), 1 deletion(-)
 create mode 100644 README_ZH.md



[servicecomb-java-chassis] branch master updated: [SCB-1525]print codec error stack (#1349)

2019-10-25 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 332ef45  [SCB-1525]print codec error stack (#1349)
332ef45 is described below

commit 332ef45ce238bbe702884dd88abbd22cb01e4d79
Author: bao liu 
AuthorDate: Sat Oct 26 09:51:29 2019 +0800

[SCB-1525]print codec error stack (#1349)

* [SCB-1525]print codec error stack
---
 .../apache/servicecomb/common/rest/RestConst.java  |  2 ++
 .../servicecomb/common/rest/codec/RestCodec.java   | 22 --
 .../swagger/engine/SwaggerProducerOperation.java   | 14 --
 3 files changed, 26 insertions(+), 12 deletions(-)

diff --git 
a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/RestConst.java
 
b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/RestConst.java
index afdc96b..454ac62 100644
--- 
a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/RestConst.java
+++ 
b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/RestConst.java
@@ -72,4 +72,6 @@ public final class RestConst {
   public static final String UPLOAD_FILE_SIZE_THRESHOLD = 
"servicecomb.uploads.fileSizeThreshold";
 
   public static final String PROVIDER_SCAN_REST_CONTROLLER = 
"servicecomb.provider.rest.scanRestController";
+
+  public static final String PRINT_CODEC_ERROR_MESSGAGE = 
"servicecomb.codec.printErrorMessage";
 }
diff --git 
a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/codec/RestCodec.java
 
b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/codec/RestCodec.java
index a1bf32d..24101cc 100644
--- 
a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/codec/RestCodec.java
+++ 
b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/codec/RestCodec.java
@@ -22,12 +22,15 @@ import java.util.List;
 import javax.servlet.http.HttpServletRequest;
 import javax.ws.rs.core.Response.Status;
 
+import org.apache.servicecomb.common.rest.RestConst;
 import org.apache.servicecomb.common.rest.definition.RestOperationMeta;
 import org.apache.servicecomb.common.rest.definition.RestParam;
 import org.apache.servicecomb.swagger.invocation.exception.InvocationException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.netflix.config.DynamicPropertyFactory;
+
 public final class RestCodec {
   private static final Logger LOG = LoggerFactory.getLogger(RestCodec.class);
 
@@ -61,12 +64,19 @@ public final class RestCodec {
   try {
 paramValues[idx] = param.getParamProcessor().getValue(request);
   } catch (Exception e) {
-// Avoid information leak of user input.
-throw new InvocationException(Status.BAD_REQUEST,
-String.format("Parameter is not valid for operation [%s]. 
Parameter is [%s]. Processor is [%s].",
-
restOperation.getOperationMeta().getMicroserviceQualifiedName(),
-param.getParamName(),
-param.getParamProcessor().getProcessorType()));
+// Avoid information leak of user input, and add option for debug use.
+String message = String.format("Parameter is not valid for operation 
[%s]. Parameter is [%s]. Processor is [%s].",
+restOperation.getOperationMeta().getMicroserviceQualifiedName(),
+param.getParamName(),
+param.getParamProcessor().getProcessorType());
+if (DynamicPropertyFactory.getInstance().getBooleanProperty(
+RestConst.PRINT_CODEC_ERROR_MESSGAGE, false).get()) {
+  LOG.error(message, e);
+  throw new InvocationException(Status.BAD_REQUEST.getStatusCode(), 
"", message, e);
+} else {
+  LOG.error("{} Add {}=true to print the details.", message, 
RestConst.PRINT_CODEC_ERROR_MESSGAGE);
+  throw new InvocationException(Status.BAD_REQUEST, message);
+}
   }
 }
 
diff --git 
a/swagger/swagger-invocation/invocation-core/src/main/java/org/apache/servicecomb/swagger/engine/SwaggerProducerOperation.java
 
b/swagger/swagger-invocation/invocation-core/src/main/java/org/apache/servicecomb/swagger/engine/SwaggerProducerOperation.java
index 5be9562..5619c15 100644
--- 
a/swagger/swagger-invocation/invocation-core/src/main/java/org/apache/servicecomb/swagger/engine/SwaggerProducerOperation.java
+++ 
b/swagger/swagger-invocation/invocation-core/src/main/java/org/apache/servicecomb/swagger/engine/SwaggerProducerOperation.java
@@ -152,15 +152,16 @@ public class SwaggerProducerOperation {
 asyncResp.handle(processException(invocation, ex));
   });
 } catch (IllegalArgumentException ae) {
+  LOGGER.error("Parameters not valid or types not match {},",
+  invoca

[servicecomb-java-chassis] branch master updated: [SCB-1511]when use method override, the generated swagger body is wrong (missed sorting)

2019-10-25 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 06b7cb8  [SCB-1511]when use method override, the generated swagger 
body is wrong (missed sorting)
06b7cb8 is described below

commit 06b7cb8f95c7b88bc27f32954ceda082d2334f8a
Author: liubao 
AuthorDate: Wed Oct 16 16:38:35 2019 +0800

[SCB-1511]when use method override, the generated swagger body is wrong 
(missed sorting)
---
 .../apache/servicecomb/swagger/generator/core/utils/MethodUtils.java| 2 +-
 .../org/apache/servicecomb/swagger/generator/core/utils/ParamUtils.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/generator/core/utils/MethodUtils.java
 
b/swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/generator/core/utils/MethodUtils.java
index 196f508..453012f 100644
--- 
a/swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/generator/core/utils/MethodUtils.java
+++ 
b/swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/generator/core/utils/MethodUtils.java
@@ -36,7 +36,7 @@ public class MethodUtils {
   }
 }
 
-producerMethods.sort(Comparator.comparing(Method::getName));
+
producerMethods.sort(Comparator.comparing(ParamUtils::findSwaggerMethodName));
 return producerMethods;
   }
 
diff --git 
a/swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/generator/core/utils/ParamUtils.java
 
b/swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/generator/core/utils/ParamUtils.java
index 768ef69..f10d6e0 100644
--- 
a/swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/generator/core/utils/ParamUtils.java
+++ 
b/swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/generator/core/utils/ParamUtils.java
@@ -163,7 +163,7 @@ public final class ParamUtils {
 return findSwaggerMethodName(method)  + "Body";
   }
 
-  protected static String findSwaggerMethodName(Method consumerMethod) {
+  public static String findSwaggerMethodName(Method consumerMethod) {
 ApiOperation apiOperationAnnotation = 
consumerMethod.getAnnotation(ApiOperation.class);
 if (apiOperationAnnotation == null || 
StringUtils.isEmpty(apiOperationAnnotation.nickname())) {
   return consumerMethod.getName();



[servicecomb-java-chassis] branch master updated (d2c06c4 -> 433e8a5)

2019-10-25 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


from d2c06c4  [SCB-1524]support register schema when old schema already 
exists
 add 433e8a5  [SCB-1544]default metrics printer should not print 0 
operations

No new revisions were added by this update.

Summary of changes:
 .../metrics/core/publish/DefaultLogPublisher.java   | 21 ++---
 1 file changed, 18 insertions(+), 3 deletions(-)



[servicecomb-java-chassis] branch master updated (4135b5b -> d2c06c4)

2019-10-25 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


from 4135b5b  [SCB-1543]java-chassis dependency structure is wrong and 
compile fail in clean environment
 add d2c06c4  [SCB-1524]support register schema when old schema already 
exists

No new revisions were added by this update.

Summary of changes:
 .../src/main/java/org/apache/servicecomb/core/SCBEngine.java |  1 +
 .../serviceregistry/config/ServiceRegistryConfig.java|  8 
 .../serviceregistry/task/MicroserviceRegisterTask.java   | 12 
 3 files changed, 17 insertions(+), 4 deletions(-)



[servicecomb-java-chassis] branch master updated: [SCB-1528] Optimizing some code implementations

2019-10-23 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new ab1783a  [SCB-1528] Optimizing some code implementations
ab1783a is described below

commit ab1783ab636ca35b4ce4c56dc2c5fba2af763920
Author: AngLi2 
AuthorDate: Wed Oct 16 16:22:11 2019 +0800

[SCB-1528] Optimizing some code implementations
---
 .../servicecomb/common/javassist/JavassistUtils.java  |  2 +-
 .../internal/converter/BodyParameterAdapter.java  |  3 ++-
 .../protobuf/internal/converter/ModelAdapter.java |  6 --
 .../protobuf/internal/converter/PropertyAdapter.java  |  3 ++-
 .../rest/codec/param/CookieProcessorCreator.java  |  3 ++-
 .../servicecomb/demo/pojo/server/CodeFirstPojo.java   | 12 
 .../org/apache/servicecomb/demo/utils/JAXBUtils.java  |  3 +++
 .../servicecomb/demo/signature/ServerSignature.java   |  4 +++-
 .../sources/ApolloConfigurationSourceImpl.java|  4 +---
 .../servicecomb/config/client/ApolloClient.java   | 12 +++-
 .../sources/ConfigCenterConfigurationSourceImpl.java  |  4 +---
 .../edge/core/URLMappedEdgeDispatcher.java| 10 +-
 .../foundation/common/log/NoCacheLog4j2Marker.java|  2 +-
 .../servicecomb/foundation/common/net/NetUtils.java   |  2 +-
 .../bizkeeper/BizkeeperExceptionUtils.java|  3 +++
 .../faultinjection/FaultInjectionUtil.java|  2 ++
 .../faultinjection/TestFaultInjectConfig.java |  4 
 .../apache/servicecomb/loadbalance/RandomRuleExt.java |  2 +-
 .../servicecomb/loadbalance/RoundRobinRuleExt.java|  2 +-
 .../loadbalance/ServiceCombLoadBalancerStats.java | 11 +--
 .../filter/InstancePropertyDiscoveryFilter.java   |  8 
 .../loadbalance/filter/IsolationDiscoveryFilter.java  |  8 
 .../loadbalance/filter/ZoneAwareDiscoveryFilter.java  |  7 ---
 .../authentication/provider/AccessController.java | 19 ++-
 .../inspector/internal/swagger/SchemaFormat.java  |  2 +-
 .../servicecomb/it/edge/PreLoadBootListener.java  |  2 +-
 .../reference/CommonToHttpServletRequest.java |  2 +-
 .../reference/TestCommonToHttpServletRequest.java |  4 ++--
 .../samples/bmi/CalculatorServiceImpl.java|  2 +-
 .../serviceregistry/api/registry/HealthCheckMode.java |  2 +-
 .../serviceregistry/api/registry/WatchAction.java |  2 +-
 .../serviceregistry/client/IpPortManager.java |  2 +-
 .../serviceregistry/client/http/RequestParam.java |  2 +-
 .../discovery/InstanceStatusDiscoveryFilter.java  |  7 ---
 .../servicecomb/swagger/converter/ConverterMgr.java   |  4 +---
 35 files changed, 82 insertions(+), 85 deletions(-)

diff --git 
a/common/common-javassist/src/main/java/org/apache/servicecomb/common/javassist/JavassistUtils.java
 
b/common/common-javassist/src/main/java/org/apache/servicecomb/common/javassist/JavassistUtils.java
index dbdc0a1..0be5b83 100644
--- 
a/common/common-javassist/src/main/java/org/apache/servicecomb/common/javassist/JavassistUtils.java
+++ 
b/common/common-javassist/src/main/java/org/apache/servicecomb/common/javassist/JavassistUtils.java
@@ -87,7 +87,7 @@ public final class JavassistUtils {
 
   @SuppressWarnings({"rawtypes", "unchecked"})
   public static Class createEnum(ClassLoader classLoader, 
String clsName, List values) {
-if (values == null || values.size() == 0) {
+if (values == null || values.isEmpty()) {
   throw new Error("values is not allowed empty.");
 }
 
diff --git 
a/common/common-protobuf/src/main/java/org/apache/servicecomb/codec/protobuf/internal/converter/BodyParameterAdapter.java
 
b/common/common-protobuf/src/main/java/org/apache/servicecomb/codec/protobuf/internal/converter/BodyParameterAdapter.java
index 9062d94..9dee93c 100644
--- 
a/common/common-protobuf/src/main/java/org/apache/servicecomb/codec/protobuf/internal/converter/BodyParameterAdapter.java
+++ 
b/common/common-protobuf/src/main/java/org/apache/servicecomb/codec/protobuf/internal/converter/BodyParameterAdapter.java
@@ -16,6 +16,7 @@
  */
 package org.apache.servicecomb.codec.protobuf.internal.converter;
 
+import java.util.Collections;
 import java.util.List;
 
 import io.swagger.models.ArrayModel;
@@ -66,7 +67,7 @@ public class BodyParameterAdapter implements 
SwaggerTypeAdapter {
   return ((ModelImpl) model).getEnum();
 }
 
-return null;
+return Collections.emptyList();
   }
 
   @Override
diff --git 
a/common/common-protobuf/src/main/java/org/apache/servicecomb/codec/protobuf/internal/converter/ModelAdapter.java
 
b/common/common-protobuf/src/main/java/org/apache/servicecomb/codec/protobuf/internal/converter/ModelAdapter.java
index 1cf99f1..78dab6b 100644
--- 
a/common/common-protobuf/src/main/java/org/apache/servi

[servicecomb-java-chassis] branch master updated: [SCB-1516] Upgrading third-party dependency versions

2019-10-10 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 451e824  [SCB-1516] Upgrading third-party dependency versions
451e824 is described below

commit 451e824dd303cf74365800102da1e1abf0bad841
Author: AngLi2 
AuthorDate: Thu Oct 10 10:23:23 2019 +0800

[SCB-1516] Upgrading third-party dependency versions
---
 java-chassis-dependencies/default/pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/java-chassis-dependencies/default/pom.xml 
b/java-chassis-dependencies/default/pom.xml
index a4dce98..b18f391 100644
--- a/java-chassis-dependencies/default/pom.xml
+++ b/java-chassis-dependencies/default/pom.xml
@@ -82,7 +82,7 @@
 3.10.4
 5.3.2.Final
 0.3.0
-4.1.28.Final
+4.1.31.Final
 3.14.2
 1.6.2
 0.6.0
@@ -102,7 +102,7 @@
 Edgware.SR3 
 1.5.22
 1.3.3
-2.0.14.Final
+2.0.22.Final
 0.10
 2.6.0
 3.6.3



[servicecomb-java-chassis] branch master updated: [SCB-1388]test on "handler-loadbalance" project, cannot all success (#1313)

2019-10-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 6f7743e  [SCB-1388]test on "handler-loadbalance" project,cannot all 
success (#1313)
6f7743e is described below

commit 6f7743e809416d6ae1065f3b79c85450b8efab75
Author: ltp217 <867813...@qq.com>
AuthorDate: Thu Oct 10 11:43:06 2019 +0800

[SCB-1388]test on "handler-loadbalance" project,cannot all success (#1313)

* [SCB-1388]test on "handler-loadbalance" project,cannot all success

* [SCB-1388]test on "handler-loadbalance" project,cannot all success
---
 .../apache/servicecomb/loadbalance/LoadbalanceHandler.java|  2 +-
 .../servicecomb/loadbalance/TestLoadBalanceHandler2.java  | 11 +++
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git 
a/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/LoadbalanceHandler.java
 
b/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/LoadbalanceHandler.java
index ae4456e..df7424a 100644
--- 
a/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/LoadbalanceHandler.java
+++ 
b/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/LoadbalanceHandler.java
@@ -71,7 +71,7 @@ public class LoadbalanceHandler implements Handler {
 
   public static final String SERVICECOMB_SERVER_ENDPOINT = "scb-endpoint";
 
-  public static final boolean supportDefinedEndpoint =
+  public final boolean supportDefinedEndpoint =
   DynamicPropertyFactory.getInstance()
   
.getBooleanProperty("servicecomb.loadbalance.userDefinedEndpoint.enabled", 
false).get();
 
diff --git 
a/handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/TestLoadBalanceHandler2.java
 
b/handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/TestLoadBalanceHandler2.java
index b76d47c..40b7a67 100644
--- 
a/handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/TestLoadBalanceHandler2.java
+++ 
b/handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/TestLoadBalanceHandler2.java
@@ -69,17 +69,12 @@ import com.google.common.eventbus.Subscribe;
  *
  */
 public class TestLoadBalanceHandler2 {
-  @BeforeClass
-  public static void beforeClass() {
-//prepare for defineEndpointAndHandle
-
ArchaiusUtils.setProperty("servicecomb.loadbalance.userDefinedEndpoint.enabled",
 "true");
-// avoid mock
-
-  }
-
   @Before
   public void setUp() {
 // clear up load balance stats
+//prepare for defineEndpointAndHandle
+
ArchaiusUtils.setProperty("servicecomb.loadbalance.userDefinedEndpoint.enabled",
 "true");
+// avoid mock
 ServiceCombLoadBalancerStats.INSTANCE.init();
 ServiceCombServerStats.releaseTryingChance();
   }



[servicecomb-java-chassis] branch master updated (2d02767 -> 24b5a1a)

2019-10-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


from 2d02767  [SCB-1511]fix review problem and unit test randomly 
fail(TestLoadBalanceHandler2)
 add 24b5a1a  [SCB-1513]merge config items according to priority.

No new revisions were added by this update.

Summary of changes:
 .../config/client/ParseConfigUtils.java| 23 ++---
 .../config/client/TestParseConfigUtils.java| 39 ++
 2 files changed, 58 insertions(+), 4 deletions(-)



[servicecomb-java-chassis] branch master updated (e351e6d -> 0c47530)

2019-09-18 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


from e351e6d  [SCB-1475] ServiceCombServerStats.getFailedRate and 
getSuccessRate  may arise an  exception of java.lang.ArithmeticException: / by 
zero under concurrency scenarios
 add 0c47530  [SCB-1488] Upgrading protobuf version to 3.7.1

No new revisions were added by this update.

Summary of changes:
 java-chassis-dependencies/default/pom.xml | 2 +-
 java-chassis-distribution/src/release/LICENSE | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)



[servicecomb-java-chassis] branch master updated: [SCB-1475] ServiceCombServerStats.getFailedRate and getSuccessRate may arise an  exception of java.lang.ArithmeticException: / by zero under concurre

2019-09-09 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new e351e6d  [SCB-1475] ServiceCombServerStats.getFailedRate and 
getSuccessRate  may arise an  exception of java.lang.ArithmeticException: / by 
zero under concurrency scenarios
e351e6d is described below

commit e351e6df66d93aace7d8187963d533efe1590d2b
Author: Liu Huaizhou 
AuthorDate: Mon Sep 2 16:53:24 2019 +0800

[SCB-1475] ServiceCombServerStats.getFailedRate and getSuccessRate  may 
arise an  exception of java.lang.ArithmeticException: / by zero under 
concurrency scenarios
---
 .../servicecomb/loadbalance/ServiceCombServerStats.java| 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git 
a/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/ServiceCombServerStats.java
 
b/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/ServiceCombServerStats.java
index b41e2da..5c50c74 100644
--- 
a/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/ServiceCombServerStats.java
+++ 
b/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/ServiceCombServerStats.java
@@ -147,17 +147,19 @@ public class ServiceCombServerStats {
   }
 
   public int getSuccessRate() {
-if (totalRequests.get() == 0L) {
-  return 0;
-}
-return (int) (successRequests.get() * 100 / totalRequests.get());
+return calcRequestRate(successRequests);
   }
 
   public int getFailedRate() {
-if (totalRequests.get() == 0L) {
+return calcRequestRate(failedRequests);
+  }
+
+  private int calcRequestRate(AtomicLong requestCnt) {
+long totalReqs = totalRequests.get();
+if (totalReqs == 0L) {
   return 0;
 }
-return (int) (failedRequests.get() * 100 / totalRequests.get());
+return (int) (requestCnt.get() * 100 / totalReqs);
   }
 
   public boolean isIsolated() {



[servicecomb-java-chassis] branch master updated: [SCB-1437] upgrading third party dependency versions

2019-08-29 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 1b90a7b  [SCB-1437] upgrading third party dependency versions
1b90a7b is described below

commit 1b90a7b6368c8395c1fdc4101dca429bcf78586e
Author: AngLi2 
AuthorDate: Thu Aug 15 10:22:50 2019 +0800

[SCB-1437] upgrading third party dependency versions
---
 java-chassis-dependencies/default/pom.xml | 37 
 java-chassis-dependencies/spring5/pom.xml |  2 +-
 java-chassis-dependencies/springboot1/pom.xml |  2 +-
 java-chassis-dependencies/springboot2/pom.xml |  2 +-
 java-chassis-distribution/src/release/LICENSE | 62 +--
 5 files changed, 52 insertions(+), 53 deletions(-)

diff --git a/java-chassis-dependencies/default/pom.xml 
b/java-chassis-dependencies/default/pom.xml
index 15d79a0..8f85feb 100644
--- a/java-chassis-dependencies/default/pom.xml
+++ b/java-chassis-dependencies/default/pom.xml
@@ -35,7 +35,7 @@
 3.7
 0.7.6
 1.6.2
-1.8.13
+1.9.3
 3.0.0
 5.6.0
 1.9.3
@@ -43,13 +43,13 @@
 2.6
 2.6
 1.2
-3.1.6
+3.3.1
 
1.0.7.fixed.3500
 8.5.32
 8.5.2
 4.0.2
 2.0.0
-3.0.1
+3.0.2
 1.14.2
 1.12.10
 26.0-jre
@@ -58,11 +58,11 @@
 6.0.2.Final
 6.0.14.Final
 4.5.7
-1.5.12
+1.5.18
 2.9.8
 3.24.0-GA
 0.26
-1.2
+1.3.2
 1
 1.5
 4.0.1
@@ -70,36 +70,35 @@
 2.0.1.Final
 2.0.1
 2.9.0
-2.22.2
-1.3.8
+2.27
+1.4.0
 1.30
 2.4
 4.12
 1.2.17
-2.11.2
+2.12.0
 1.2.3
 1.10.19
 3.10.4
 5.3.2.Final
 0.3.0
 4.1.28.Final
-3.11.0
+3.14.2
 1.6.2
+0.6.0
 3.6.1
 1.5.9
 2.2.25
-2.2.5
+2.3.0
 1.1.6
 0.4.9
 1.0.0
 0.12.25
-0.3.0
-0.1.0
 1.7.26
-1.23
+1.24
 0.83.0
 4.3.20.RELEASE
-1.5.12.RELEASE
+1.5.19.RELEASE
 Edgware.SR3 
 1.5.22
 1.3.3
@@ -108,10 +107,10 @@
 2.6.0
 3.6.3
 4.4.1
-1.4.9
+1.4.11.1
 2.9.3
 2.7.13
-3.4.13
+3.4.14
 
 ${basedir}/../..
   
@@ -495,12 +494,12 @@
   
 io.prometheus
 simpleclient
-${simpleclient.version}
+${prometheus.version}
   
   
 io.prometheus
 simpleclient_httpserver
-${simpleclient-httpserver.version}
+${prometheus.version}
   
 
   
@@ -734,7 +733,7 @@
   
 org.aspectj
 aspectjweaver
-${aspectjweaver.version}
+${aspectj.version}
   
 
   
diff --git a/java-chassis-dependencies/spring5/pom.xml 
b/java-chassis-dependencies/spring5/pom.xml
index bab93ba..53b8065 100644
--- a/java-chassis-dependencies/spring5/pom.xml
+++ b/java-chassis-dependencies/spring5/pom.xml
@@ -31,7 +31,7 @@
   pom
 
   
-5.0.7.RELEASE
+5.1.5.RELEASE
   
 
   
diff --git a/java-chassis-dependencies/springboot1/pom.xml 
b/java-chassis-dependencies/springboot1/pom.xml
index fe3f8a6..d1375e5 100644
--- a/java-chassis-dependencies/springboot1/pom.xml
+++ b/java-chassis-dependencies/springboot1/pom.xml
@@ -31,7 +31,7 @@
   pom
 
   
-1.5.14.RELEASE
+1.5.19.RELEASE
   
 
   
diff --git a/java-chassis-dependencies/springboot2/pom.xml 
b/java-chassis-dependencies/springboot2/pom.xml
index d1e3407..174afc7 100644
--- a/java-chassis-dependencies/springboot2/pom.xml
+++ b/java-chassis-dependencies/springboot2/pom.xml
@@ -32,7 +32,7 @@
 
   
 
-2.1.2.RELEASE
+2.1.6.RELEASE
 Greenwich.RELEASE
 
 1.0.0
diff --git a/java-chassis-distribution/src/release/LICENSE 
b/java-chassis-distribution/src/release/LICENSE
index 7b82b40..7aabed8 100644
--- a/java-chassis-distribution/src/release/LICENSE
+++ b/java-chassis-distribution/src/release/LICENSE
@@ -229,7 +229,7 @@ This product bundles libraries which are licensed under the
 Eclipse Public License v1.0.
 You can find a copy of the License at licenses/LICENSE-epl-v10
 
-* AspectJ weaver (org.aspectj:aspectjweaver:1.8.8 - http://www.aspectj.org)
+* AspectJ weaver (org.aspectj:aspectjweaver:1.9.3 - http://www.aspectj.org)
 * JUnit (junit:junit:4.12 - http://junit.org)
 * Dirgra (org.jruby:dirgra:0.3 - https://github.com/jruby/dirgra)
 
@@ -280,9 +280,9 @@ You can find a copy of the License at licenses/LICENSE-cddl
 * Expression Language 3.0 (org.glassfish:javax.el:3.0.0 - 
http://el-spec.java.net)
 * Java Servlet API (javax.servlet:javax.servlet-api:4.0.1 - 
http://servlet-spec.java.net)
 * javax.ws.rs-api (javax.ws.rs:javax.ws.rs-api:2.0.1 - 
http://jax-rs-spec.java.net)
-* Jersey Apache HTTP Client 4.x 
(com.sun.jersey.contribs:jersey-apache-client4:1.19.1 - 
https://jersey.java.net/jersey-contribs/jersey-apache-client4/)
-* jersey-client (com.sun.jersey:jersey-client

[servicecomb-java-chassis] 02/03: [SCB-1450] change servicecomb.service.registry.client.workerPoolSize to servicecomb.service.registry.client.instance for workerPoolSize can not indicate how many vert

2019-08-29 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit 148fd2a10749ec2ebb7e19de5443fc6d0cc7e0b2
Author: Liu Huaizhou 
AuthorDate: Tue Aug 20 14:53:14 2019 +0800

[SCB-1450] change servicecomb.service.registry.client.workerPoolSize to 
servicecomb.service.registry.client.instance for workerPoolSize can not 
indicate how many verticle instances had been deployed.
---
 .../serviceregistry/config/ServiceRegistryConfig.java | 19 ++-
 .../config/TestServiceRegistryConfig.java |  2 +-
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/config/ServiceRegistryConfig.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/config/ServiceRegistryConfig.java
index 98e126d..13a19e9 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/config/ServiceRegistryConfig.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/config/ServiceRegistryConfig.java
@@ -109,22 +109,23 @@ public final class ServiceRegistryConfig {
 return HttpVersion.valueOf(property.get());
   }
 
-  public int getWorkerPoolSize() {
-String workerPoolSizeKey = 
"servicecomb.service.registry.client.workerPoolSize";
+  public int getInstances() {
+String instances = "servicecomb.service.registry.client.instances ";
 DynamicIntProperty property =
-DynamicPropertyFactory.getInstance()
-.getIntProperty(workerPoolSizeKey, 1);
-int workerPoolSize = property.get();
-if (workerPoolSize <= 0) {
+DynamicPropertyFactory.getInstance()
+.getIntProperty(instances, 1);
+int deployInstances = property.get();
+if (deployInstances <= 0) {
   int nAvailableProcessors = Runtime.getRuntime().availableProcessors();
   LOGGER.warn("The property `{}` must be positive integer, fallback to use 
number of available processors: {}",
-  workerPoolSizeKey,
-  nAvailableProcessors);
+  instances,
+  nAvailableProcessors);
   return nAvailableProcessors;
 }
-return workerPoolSize;
+return deployInstances;
   }
 
+
   public boolean isSsl() {
 getIpPort();
 return this.ssl;
diff --git 
a/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/config/TestServiceRegistryConfig.java
 
b/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/config/TestServiceRegistryConfig.java
index 899cea8..061c2e9 100644
--- 
a/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/config/TestServiceRegistryConfig.java
+++ 
b/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/config/TestServiceRegistryConfig.java
@@ -52,7 +52,7 @@ public class TestServiceRegistryConfig {
 Assert.assertNotEquals(null, oConfig.getHeartbeatInterval());
 Assert.assertEquals("HTTP_1_1", oConfig.getHttpVersion().name());
 Assert.assertEquals("rest", oConfig.getTransport());
-Assert.assertEquals(1, oConfig.getWorkerPoolSize());
+Assert.assertEquals(1, oConfig.getInstances());
 Assert.assertTrue(oConfig.isSsl());
 Assert.assertEquals(3, oConfig.getRequestTimeout());
 Assert.assertEquals(3000, oConfig.getHeartBeatRequestTimeout());



[servicecomb-java-chassis] 01/03: [SCB-1450] Change Registry WebsocketClient work module to a worker verticle, So it can support blocking-task, like Service Center watching task.

2019-08-29 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit 1e16ca4d5a151e126b6071dcdd1e8d75669573cd
Author: Liuhuaizhou 
AuthorDate: Tue Aug 20 14:45:45 2019 +0800

[SCB-1450] Change Registry WebsocketClient work module  to a worker 
verticle,So it can support blocking-task,like Service Center watching task.
---
 .../client/http/AbstractClientPool.java| 27 ++
 .../client/http/HttpClientPool.java|  5 
 .../client/http/WebsocketClientPool.java   |  5 
 3 files changed, 32 insertions(+), 5 deletions(-)

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/AbstractClientPool.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/AbstractClientPool.java
index a631b96..846fea8 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/AbstractClientPool.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/AbstractClientPool.java
@@ -17,6 +17,9 @@
 
 package org.apache.servicecomb.serviceregistry.client.http;
 
+import com.netflix.config.DynamicIntProperty;
+import com.netflix.config.DynamicPropertyFactory;
+
 import org.apache.servicecomb.foundation.vertx.AddressResolverConfig;
 import org.apache.servicecomb.foundation.vertx.VertxUtils;
 import org.apache.servicecomb.foundation.vertx.client.ClientPoolManager;
@@ -42,27 +45,41 @@ public abstract class AbstractClientPool implements 
ClientPool {
 
   public static final String PROXY_KEY = "sc.consumer";
 
+  private static final String EVENT_LOOP_POOL_SIZE = 
"servicecomb.service.registry.client.eventLoopPoolSize";
+
+  private static final String WORKER_POOL_SIZE = 
"servicecomb.service.registry.client.workerPoolSize";
+
+  private static final String WORKER_POOL_NAME = 
"registry-vert.x-worker-thread";
+
   private ClientPoolManager clientMgr;
 
   public AbstractClientPool() {
 create();
   }
 
+  protected abstract boolean isWorker();
+
   public HttpClientWithContext getClient() {
 return this.clientMgr.findThreadBindClientPool();
   }
 
   public void create() {
+DynamicIntProperty property = 
DynamicPropertyFactory.getInstance().getIntProperty(EVENT_LOOP_POOL_SIZE, 4);
+DynamicIntProperty workerPoolSize = 
DynamicPropertyFactory.getInstance().getIntProperty(WORKER_POOL_SIZE, 4);
+
 // 这里面是同步接口,且好像直接在事件线程中用,保险起见,先使用独立的vertx实例
-VertxOptions vertxOptions = new VertxOptions();
-
vertxOptions.setAddressResolverOptions(AddressResolverConfig.getAddressResover(SSL_KEY));
+VertxOptions vertxOptions = new VertxOptions()
+
.setAddressResolverOptions(AddressResolverConfig.getAddressResover(SSL_KEY))
+.setEventLoopPoolSize(property.get());
 Vertx vertx = VertxUtils.getOrCreateVertxByName("registry", vertxOptions);
 HttpClientOptions httpClientOptions = createHttpClientOptions();
 clientMgr = new ClientPoolManager<>(vertx, new 
HttpClientPoolFactory(httpClientOptions));
 
-DeploymentOptions deployOptions =
-VertxUtils.createClientDeployOptions(this.clientMgr,
-ServiceRegistryConfig.INSTANCE.getWorkerPoolSize());
+DeploymentOptions deployOptions = 
VertxUtils.createClientDeployOptions(this.clientMgr,
+ServiceRegistryConfig.INSTANCE.getInstances())
+.setWorker(isWorker())
+.setWorkerPoolName(WORKER_POOL_NAME)
+.setWorkerPoolSize(workerPoolSize.get());
 try {
   VertxUtils.blockDeploy(vertx, ClientVerticle.class, deployOptions);
 } catch (InterruptedException e) {
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/HttpClientPool.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/HttpClientPool.java
index efbee4c..71b400b 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/HttpClientPool.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/HttpClientPool.java
@@ -40,6 +40,11 @@ public final class HttpClientPool extends AbstractClientPool 
{
   }
 
   @Override
+  protected boolean isWorker() {
+return false;
+  }
+
+  @Override
   public HttpClientOptions createHttpClientOptions() {
 HttpVersion ver = ServiceRegistryConfig.INSTANCE.getHttpVersion();
 HttpClientOptions httpClientOptions = new HttpClientOptions();
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/WebsocketClientPool.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/WebsocketClientPool.java
index a8b14ab..3242043 100644
--- 
a/service-registry/src/main/java/org/apache/servicec

[servicecomb-java-chassis] 03/03: [SCB-1450] fix code review comments

2019-08-29 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit 686395ad888414e0e4079892a03e0d7ea304e108
Author: Liu Huaizhou 
AuthorDate: Mon Aug 26 16:52:03 2019 +0800

[SCB-1450] fix code review comments
---
 .../client/http/AbstractClientPool.java| 20 +-
 .../client/http/HttpClientPool.java|  4 ++--
 .../client/http/WebsocketClientPool.java   |  2 +-
 .../config/ServiceRegistryConfig.java  | 24 --
 4 files changed, 26 insertions(+), 24 deletions(-)

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/AbstractClientPool.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/AbstractClientPool.java
index 846fea8..5992c05 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/AbstractClientPool.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/AbstractClientPool.java
@@ -41,17 +41,7 @@ import io.vertx.core.http.HttpClientOptions;
 public abstract class AbstractClientPool implements ClientPool {
   private static final Logger LOGGER = 
LoggerFactory.getLogger(AbstractClientPool.class);
 
-  protected static final String SSL_KEY = "sc.consumer";
-
-  public static final String PROXY_KEY = "sc.consumer";
-
-  private static final String EVENT_LOOP_POOL_SIZE = 
"servicecomb.service.registry.client.eventLoopPoolSize";
-
-  private static final String WORKER_POOL_SIZE = 
"servicecomb.service.registry.client.workerPoolSize";
-
-  private static final String WORKER_POOL_NAME = 
"registry-vert.x-worker-thread";
-
-  private ClientPoolManager clientMgr;
+private ClientPoolManager clientMgr;
 
   public AbstractClientPool() {
 create();
@@ -64,12 +54,12 @@ public abstract class AbstractClientPool implements 
ClientPool {
   }
 
   public void create() {
-DynamicIntProperty property = 
DynamicPropertyFactory.getInstance().getIntProperty(EVENT_LOOP_POOL_SIZE, 4);
-DynamicIntProperty workerPoolSize = 
DynamicPropertyFactory.getInstance().getIntProperty(WORKER_POOL_SIZE, 4);
+DynamicIntProperty property = 
DynamicPropertyFactory.getInstance().getIntProperty(ServiceRegistryConfig.EVENT_LOOP_POOL_SIZE,
 4);
+DynamicIntProperty workerPoolSize = 
DynamicPropertyFactory.getInstance().getIntProperty(ServiceRegistryConfig.WORKER_POOL_SIZE,
 4);
 
 // 这里面是同步接口,且好像直接在事件线程中用,保险起见,先使用独立的vertx实例
 VertxOptions vertxOptions = new VertxOptions()
-
.setAddressResolverOptions(AddressResolverConfig.getAddressResover(SSL_KEY))
+
.setAddressResolverOptions(AddressResolverConfig.getAddressResover(ServiceRegistryConfig.SSL_KEY))
 .setEventLoopPoolSize(property.get());
 Vertx vertx = VertxUtils.getOrCreateVertxByName("registry", vertxOptions);
 HttpClientOptions httpClientOptions = createHttpClientOptions();
@@ -78,7 +68,7 @@ public abstract class AbstractClientPool implements 
ClientPool {
 DeploymentOptions deployOptions = 
VertxUtils.createClientDeployOptions(this.clientMgr,
 ServiceRegistryConfig.INSTANCE.getInstances())
 .setWorker(isWorker())
-.setWorkerPoolName(WORKER_POOL_NAME)
+.setWorkerPoolName(ServiceRegistryConfig.WORKER_POOL_NAME)
 .setWorkerPoolSize(workerPoolSize.get());
 try {
   VertxUtils.blockDeploy(vertx, ClientVerticle.class, deployOptions);
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/HttpClientPool.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/HttpClientPool.java
index 71b400b..a313669 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/HttpClientPool.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/HttpClientPool.java
@@ -56,7 +56,7 @@ public final class HttpClientPool extends AbstractClientPool {
   proxy.setHost(ServiceRegistryConfig.INSTANCE.getProxyHost());
   proxy.setPort(ServiceRegistryConfig.INSTANCE.getProxyPort());
   proxy.setUsername(ServiceRegistryConfig.INSTANCE.getProxyUsername());
-  
proxy.setPassword(Encryptions.decode(ServiceRegistryConfig.INSTANCE.getProxyPasswd(),
 PROXY_KEY));
+  
proxy.setPassword(Encryptions.decode(ServiceRegistryConfig.INSTANCE.getProxyPasswd(),
 ServiceRegistryConfig.PROXY_KEY));
   httpClientOptions.setProxyOptions(proxy);
 }
 if (ver == HttpVersion.HTTP_2) {
@@ -65,7 +65,7 @@ public final class HttpClientPool extends AbstractClientPool {
 }
 if (ServiceRegistryConfig.INSTANCE.isSsl()) {
   LOGGER.debug("service center client performs requests 

[servicecomb-java-chassis] branch master updated (3da6ff5 -> 686395a)

2019-08-29 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


from 3da6ff5  delete redundant logic
 new 1e16ca4  [SCB-1450] Change Registry WebsocketClient work module  to a 
worker verticle,So it can support blocking-task,like Service Center watching 
task.
 new 148fd2a  [SCB-1450] change 
servicecomb.service.registry.client.workerPoolSize to 
servicecomb.service.registry.client.instance for workerPoolSize can not 
indicate how many verticle instances had been deployed.
 new 686395a  [SCB-1450] fix code review comments

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/AbstractClientPool.java| 27 
 .../client/http/HttpClientPool.java|  9 +--
 .../client/http/WebsocketClientPool.java   |  7 +-
 .../config/ServiceRegistryConfig.java  | 29 --
 .../config/TestServiceRegistryConfig.java  |  2 +-
 5 files changed, 52 insertions(+), 22 deletions(-)



[servicecomb-docs] branch master updated: [SCB-1451]Printing the service information on the log

2019-08-22 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

yaohaishi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-docs.git


The following commit(s) were added to refs/heads/master by this push:
 new e3c5bad  [SCB-1451]Printing the service information on the log
e3c5bad is described below

commit e3c5bad453619b5f7921967918fab9f734ddfd87
Author: ZihangJiao 
AuthorDate: Thu Aug 22 17:22:30 2019 +0800

[SCB-1451]Printing the service information on the log
---
 .../service-information-printer.md | 64 
 .../service-information-printer.md | 68 ++
 2 files changed, 132 insertions(+)

diff --git 
a/java-chassis-reference/en_US/general-development/service-information-printer.md
 
b/java-chassis-reference/en_US/general-development/service-information-printer.md
new file mode 100644
index 000..684df9d
--- /dev/null
+++ 
b/java-chassis-reference/en_US/general-development/service-information-printer.md
@@ -0,0 +1,64 @@
+# Printing Service Information
+## Conception Illustration
+In order make it easier and faster for users to gather the service 
information, those data are collected and printed on the log.
+## effect
+How the printing looks like:  
+No matter the initialization of the service succeeded or not, the service 
information will be printed at the end of the log, users can search by "Service 
Information is shown below" to locate it
+```
+2019-08-21 16:37:14,859 [INFO] Service information is shown below:
+service center: [http://127.0.0.1:30100]
+config center: [http://127.0.0.1:30113]
+AppID: Restful-Service-HelloWorld
+ServiceName: restful_provider
+Version: 0.0.1
+Environment: production
+ServiceID: a3344e9ad4557f883b36d7f53e33306fbc0a54ad
+InstanceID; e0765a8ec3ee11e9910d0255ac105780
+ 
org.apache.servicecomb.core.SCBEngine$1.afterRegistryInstance(SCBEngine.java:243)
+```
+
+## extension
+### related interfaces and classes
+1. interface: BootUpInformationCollector
+> collect(): return a string,which is the information that should be printed 
on the log  
+> getOrder():return the priority of the implementation classes of 
BootUpInformationCollector, the smaller the number, the higher the priority.  
+
+### how users implement extension
+to make extension of the printing service, user need to:
+1. Create new classes that implements Interface BootUpInformationCollector, 
and set the appropriate order.
+2. Create SPI file.
+
+### example
+1. Create a new implementation class HelloCollector.
+```java
+public class HelloCollector implements BootUpInformationCollector {
+  @Override
+  public String collect() {
+return "Hello!";
+  }
+
+  @Override
+  public int getOrder() {
+return 5;
+  }
+}
+```
+because the order of this class is 5, it will be printed between the address 
information(order 0) and service information(order 200)  
+2. Create SPI file  
+create new SPI file under directory resources/META-INF/services  
+name of the file: 
org.apache.servicecomb.core.bootup.BootUpInformationCollector  
+content: the class name of HelloCollector  
+3. printing effect
+```
+   2019-08-21 16:37:14,859 [INFO] Service information is shown below:
+   service center: [http://127.0.0.1:30100]
+   config center: [http://127.0.0.1:30113]
+   Hello!
+   AppID: Restful-Service-HelloWorld
+   ServiceName: restful_provider
+   Version: 0.0.1
+   Environment: production
+   ServiceID: a3344e9ad4557f883b36d7f53e33306fbc0a54ad
+   InstanceID; e0765a8ec3ee11e9910d0255ac105780
+
org.apache.servicecomb.core.SCBEngine$1.afterRegistryInstance(SCBEngine.java:243)
+```
diff --git 
a/java-chassis-reference/zh_CN/general-development/service-information-printer.md
 
b/java-chassis-reference/zh_CN/general-development/service-information-printer.md
new file mode 100644
index 000..af50424
--- /dev/null
+++ 
b/java-chassis-reference/zh_CN/general-development/service-information-printer.md
@@ -0,0 +1,68 @@
+# 服务信息打印
+
+## 概念阐述
+
+为了使用户可以更快捷,方便的获得服务信息,将服务信息进行整理,并在日志中打印出来
+
+## 效果
+不论服务创建成功与否,服务信息都会在日志信息的末尾被自动打出,用户可以通过搜索"Service Information is shown below"进行定位
+```
+2019-08-21 16:37:14,859 [INFO] Service information is shown below:
+service center: [http://127.0.0.1:30100]
+config center: [http://127.0.0.1:30113]
+AppID: Restful-Service-HelloWorld
+ServiceName: restful_provider
+Version: 0.0.1
+Environment: production
+ServiceID: a3344e9ad4557f883b36d7f53e33306fbc0a54ad
+InstanceID; e0765a8ec3ee11e9910d0255ac105780
+ 
org.apache.servicecomb.core.SCBEngine$1.afterRegistryInstance(SCBEngine.java:243)
+```
+
+## 扩展
+
+### 相关的接口
+接口BootUpInformationCollector
+> collect(): 返回一个string,也就是服务中需要打印的信息  
+> getOrder(): 返回BootUpInformationCollector实现类的优先级,数字越小优先级越高
+
+### 用户扩展
+
+用户如果需要对打印信息进行进一步扩展,需要
+1. 根据BootUpInformationCollector创建新的类,并赋予合适的order。
+2. 创建SPI文件
+
+### 样例
+1. 创建一个新的实现类HelloCollector
+```java
+public class HelloCollector implements

[servicecomb-java-chassis] branch master updated: [SCB-1451] Printing the service information on the log

2019-08-22 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 79653ba  [SCB-1451] Printing the service information on the log
79653ba is described below

commit 79653ba4c7c32c56a7ceb18fc8c02e2709f78e8c
Author: ZihangJiao 
AuthorDate: Thu Aug 22 14:53:05 2019 +0800

[SCB-1451] Printing the service information on the log
---
 .../org/apache/servicecomb/core/SCBEngine.java | 17 +
 .../core/bootup/AddressInformationCollector.java   | 44 ++
 .../core/bootup/BootUpInformationCollector.java| 24 
 .../core/bootup/ServiceInformationCollector.java   | 39 +++
 ...vicecomb.core.bootup.BootUpInformationCollector | 19 ++
 5 files changed, 143 insertions(+)

diff --git a/core/src/main/java/org/apache/servicecomb/core/SCBEngine.java 
b/core/src/main/java/org/apache/servicecomb/core/SCBEngine.java
index ff3e804..27d9db8 100644
--- a/core/src/main/java/org/apache/servicecomb/core/SCBEngine.java
+++ b/core/src/main/java/org/apache/servicecomb/core/SCBEngine.java
@@ -30,6 +30,7 @@ import org.apache.servicecomb.config.ConfigUtil;
 import org.apache.servicecomb.config.priority.PriorityPropertyManager;
 import org.apache.servicecomb.core.BootListener.BootEvent;
 import org.apache.servicecomb.core.BootListener.EventType;
+import org.apache.servicecomb.core.bootup.BootUpInformationCollector;
 import org.apache.servicecomb.core.definition.MicroserviceMeta;
 import org.apache.servicecomb.core.definition.loader.SchemaListenerManager;
 import org.apache.servicecomb.core.definition.schema.StaticSchemaFactory;
@@ -89,6 +90,9 @@ public class SCBEngine {
 
   private PriorityPropertyManager priorityPropertyManager = new 
PriorityPropertyManager();
 
+  protected List bootUpInformationCollectors = 
SPIServiceUtils
+  .getSortedService(BootUpInformationCollector.class);
+
   private static final SCBEngine INSTANCE = new SCBEngine();
 
   public void setStatus(SCBStatus status) {
@@ -185,6 +189,7 @@ public class SCBEngine {
   @Subscribe
   public void afterRegistryInstance(MicroserviceInstanceRegisterTask 
microserviceInstanceRegisterTask) {
 LOGGER.info("receive MicroserviceInstanceRegisterTask event, check 
instance Id...");
+
 if 
(!StringUtils.isEmpty(RegistryUtils.getMicroserviceInstance().getInstanceId())) 
{
   LOGGER.info("instance registry succeeds for the first time, will 
send AFTER_REGISTRY event.");
   status = SCBStatus.UP;
@@ -223,10 +228,22 @@ public class SCBEngine {
 }
 status = SCBStatus.FAILED;
 throw new IllegalStateException("ServiceComb init failed.", e);
+  } finally {
+printServiceInfo();
   }
 }
   }
 
+  private void printServiceInfo() {
+StringBuilder serviceInfo = new StringBuilder();
+serviceInfo.append("Service information is shown below:\n");
+for (int i = 0; i < bootUpInformationCollectors.size(); i++) {
+  
serviceInfo.append(bootUpInformationCollectors.get(i).collect()).append('\n');
+}
+LOGGER.info(serviceInfo.toString());
+  }
+
+
   private void doInit() throws Exception {
 status = SCBStatus.STARTING;
 
diff --git 
a/core/src/main/java/org/apache/servicecomb/core/bootup/AddressInformationCollector.java
 
b/core/src/main/java/org/apache/servicecomb/core/bootup/AddressInformationCollector.java
new file mode 100644
index 000..ca7cf7d
--- /dev/null
+++ 
b/core/src/main/java/org/apache/servicecomb/core/bootup/AddressInformationCollector.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.core.bootup;
+
+import org.apache.servicecomb.deployment.Deployment;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+public class AddressInformationCollector implements BootUpInformationCollector 
{
+  @Override
+  public String collect() {
+return "service center: "
++ getCenterInfo(Deployment.

[servicecomb-java-chassis] 02/02: [SCB-1297] fix CI that DynamicProperty can not get Spring properties

2019-08-14 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit 55b0f165b58a70868a2e69083b1d30a3b8f82838
Author: l00393086 
AuthorDate: Tue Aug 13 16:37:39 2019 +0800

[SCB-1297] fix CI that DynamicProperty can not get Spring properties
---
 .../servicecomb/config/ConfigurationSpringInitializer.java  | 13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git 
a/foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigurationSpringInitializer.java
 
b/foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigurationSpringInitializer.java
index c7472c7..bf380f6 100644
--- 
a/foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigurationSpringInitializer.java
+++ 
b/foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigurationSpringInitializer.java
@@ -76,9 +76,6 @@ public class ConfigurationSpringInitializer extends 
PropertyPlaceholderConfigure
*/
   @Override
   public void setEnvironment(Environment environment) {
-
-ConfigUtil.installDynamicConfig();
-
 String environmentName = generateNameForEnvironment(environment);
 LOGGER.info("Environment received, will get configurations from [{}].", 
environmentName);
 
@@ -86,6 +83,8 @@ public class ConfigurationSpringInitializer extends 
PropertyPlaceholderConfigure
 
 ConfigUtil.addExtraConfig(EXTRA_CONFIG_SOURCE_PREFIX + environmentName, 
extraConfig);
 
+ConfigUtil.installDynamicConfig();
+
 setUpSpringPropertySource(environment);
   }
 
@@ -204,7 +203,7 @@ public class ConfigurationSpringInitializer extends 
PropertyPlaceholderConfigure
   if (ignoreResolveFailure()) {
 LOGGER.warn("set up spring property source failed.", e);
   } else {
-throw new RuntimeException("set up spring property source 
failed.If you still want to start up the application and ignore the errors, you 
can set servicecomb.config.ignoreResolveFailure to true.", e);
+throw new RuntimeException("set up spring property source 
failed.If you still want to start up the application and ignore errors, you can 
set servicecomb.config.ignoreResolveFailure to true.", e);
   }
 }
   }
@@ -215,8 +214,8 @@ public class ConfigurationSpringInitializer extends 
PropertyPlaceholderConfigure
   }
 
   private boolean ignoreResolveFailure() {
-return DynamicPropertyFactory.getInstance()
-.getBooleanProperty("servicecomb.config.ignoreResolveFailure", 
false)
-.get();
+return ConfigUtil
+.createLocalConfig()
+.getBoolean("servicecomb.config.ignoreResolveFailure", false);
   }
 }



[servicecomb-java-chassis] branch master updated (be73f2e -> 55b0f16)

2019-08-14 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


from be73f2e  [SCB-1431] set all dependency versions as properties
 new 7e23a66  [SCB-1297] NPE would be arised if you haven't given any value 
for servicecomb.config.ignoreResolveFailure
 new 55b0f16  [SCB-1297] fix CI that DynamicProperty can not get Spring 
properties

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:
 .../config/ConfigurationSpringInitializer.java | 12 +++-
 .../config/TestConfigurationSpringInitializer.java | 22 ++
 2 files changed, 29 insertions(+), 5 deletions(-)



[servicecomb-java-chassis] 01/02: [SCB-1297] NPE would be arised if you haven't given any value for servicecomb.config.ignoreResolveFailure

2019-08-14 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit 7e23a668ceb7e02cf1e3558a17e80edd9f688357
Author: l00393086 
AuthorDate: Mon Aug 12 16:06:12 2019 +0800

[SCB-1297] NPE would be arised if you haven't given any value for 
servicecomb.config.ignoreResolveFailure
---
 .../config/ConfigurationSpringInitializer.java | 17 ++---
 .../config/TestConfigurationSpringInitializer.java | 22 ++
 2 files changed, 32 insertions(+), 7 deletions(-)

diff --git 
a/foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigurationSpringInitializer.java
 
b/foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigurationSpringInitializer.java
index ae6d217..c7472c7 100644
--- 
a/foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigurationSpringInitializer.java
+++ 
b/foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigurationSpringInitializer.java
@@ -76,6 +76,9 @@ public class ConfigurationSpringInitializer extends 
PropertyPlaceholderConfigure
*/
   @Override
   public void setEnvironment(Environment environment) {
+
+ConfigUtil.installDynamicConfig();
+
 String environmentName = generateNameForEnvironment(environment);
 LOGGER.info("Environment received, will get configurations from [{}].", 
environmentName);
 
@@ -83,8 +86,6 @@ public class ConfigurationSpringInitializer extends 
PropertyPlaceholderConfigure
 
 ConfigUtil.addExtraConfig(EXTRA_CONFIG_SOURCE_PREFIX + environmentName, 
extraConfig);
 
-ConfigUtil.installDynamicConfig();
-
 setUpSpringPropertySource(environment);
   }
 
@@ -200,10 +201,10 @@ public class ConfigurationSpringInitializer extends 
PropertyPlaceholderConfigure
 try {
   configFromSpringBoot.put(propertyName, 
environment.getProperty(propertyName, Object.class));
 } catch (Exception e) {
-  if (!getIfIgnoreEnvironment()) {
-throw new RuntimeException("set up spring property source 
failed.", e);
-  } else {
+  if (ignoreResolveFailure()) {
 LOGGER.warn("set up spring property source failed.", e);
+  } else {
+throw new RuntimeException("set up spring property source 
failed.If you still want to start up the application and ignore the errors, you 
can set servicecomb.config.ignoreResolveFailure to true.", e);
   }
 }
   }
@@ -213,7 +214,9 @@ public class ConfigurationSpringInitializer extends 
PropertyPlaceholderConfigure
 LOGGER.debug("a none EnumerablePropertySource is ignored, 
propertySourceName = [{}]", propertySource.getName());
   }
 
-  private boolean getIfIgnoreEnvironment() {
-return (Boolean) 
ConfigUtil.createLocalConfig().getProperty("servicecomb.config.ignoreResolveFailure");
+  private boolean ignoreResolveFailure() {
+return DynamicPropertyFactory.getInstance()
+.getBooleanProperty("servicecomb.config.ignoreResolveFailure", 
false)
+.get();
   }
 }
diff --git 
a/foundations/foundation-config/src/test/java/org/apache/servicecomb/config/TestConfigurationSpringInitializer.java
 
b/foundations/foundation-config/src/test/java/org/apache/servicecomb/config/TestConfigurationSpringInitializer.java
index c50e01e..ac20e23 100644
--- 
a/foundations/foundation-config/src/test/java/org/apache/servicecomb/config/TestConfigurationSpringInitializer.java
+++ 
b/foundations/foundation-config/src/test/java/org/apache/servicecomb/config/TestConfigurationSpringInitializer.java
@@ -43,6 +43,9 @@ import org.springframework.core.env.CompositePropertySource;
 import org.springframework.core.env.ConfigurableEnvironment;
 import org.springframework.core.env.MapPropertySource;
 import org.springframework.core.env.MutablePropertySources;
+import org.springframework.core.env.PropertySource;
+import org.springframework.core.env.StandardEnvironment;
+import org.springframework.core.env.SystemEnvironmentPropertySource;
 import org.springframework.jndi.JndiPropertySource;
 
 import com.netflix.config.ConfigurationManager;
@@ -224,8 +227,27 @@ public class TestConfigurationSpringInitializer {
 assertEquals("value2", extraProperties.get("key2"));
   }
 
+  @Test(expected = RuntimeException.class)
+  public void shoud_throw_exception_when_given_ignoreResolveFailure_false() {
+StandardEnvironment environment = newStandardEnvironment();
+
+ConfigurationSpringInitializer configurationSpringInitializer = new 
ConfigurationSpringInitializer();
+configurationSpringInitializer.setEnvironment(environment);
+  }
+
   private Map> getExtraConfigMapFromConfigUtil() {
 return Deencapsulation
 .getField(ConfigUtil.class, "EXTRA_CONFIG_MAP")

[servicecomb-java-chassis] branch master updated: [SCB-1431] set all dependency versions as properties

2019-08-14 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new be73f2e  [SCB-1431] set all dependency versions as properties
be73f2e is described below

commit be73f2ea603b254244912f8944ffe2d3f70e549d
Author: AngLi2 
AuthorDate: Mon Aug 12 17:08:19 2019 +0800

[SCB-1431] set all dependency versions as properties
---
 java-chassis-dependencies/default/pom.xml | 1212 ++---
 java-chassis-dependencies/spring4/pom.xml |1 +
 java-chassis-dependencies/spring5/pom.xml |   37 +-
 java-chassis-dependencies/springboot1/pom.xml |   19 +-
 java-chassis-dependencies/springboot2/pom.xml |   10 +-
 5 files changed, 699 insertions(+), 580 deletions(-)

diff --git a/java-chassis-dependencies/default/pom.xml 
b/java-chassis-dependencies/default/pom.xml
index 3bccb80..15d79a0 100644
--- a/java-chassis-dependencies/default/pom.xml
+++ b/java-chassis-dependencies/default/pom.xml
@@ -31,70 +31,94 @@
   pom
 
   
+
+3.7
+0.7.6
+1.6.2
+1.8.13
+3.0.0
+5.6.0
+1.9.3
+1.10
+2.6
+2.6
+1.2
+3.1.6
+
1.0.7.fixed.3500
+8.5.32
+8.5.2
+4.0.2
+2.0.0
+3.0.1
+1.14.2
+1.12.10
+26.0-jre
+4.2.0
+1.3
+6.0.2.Final
+6.0.14.Final
+4.5.7
+1.5.12
 2.9.8
-3.6.3
-0.10
-4.3.20.RELEASE
-1.7.26
+3.24.0-GA
+0.26
+1.2
+1
+1.5
+4.0.1
+1.2
+2.0.1.Final
+2.0.1
+2.9.0
+2.22.2
+1.3.8
+1.30
+2.4
+4.12
 1.2.17
 2.11.2
-2.6
-3.24.0-GA
-2.0.1
-4.0.1
-4.5.7
+1.2.3
+1.10.19
+3.10.4
+5.3.2.Final
+0.3.0
+4.1.28.Final
+3.11.0
+1.6.2
+3.6.1
 1.5.9
+2.2.25
+2.2.5
+1.1.6
+0.4.9
+1.0.0
+0.12.25
+0.3.0
+0.1.0
+1.7.26
+1.23
+0.83.0
+4.3.20.RELEASE
+1.5.12.RELEASE
+Edgware.SR3 
 1.5.22
-4.1.28.Final
+1.3.3
 2.0.14.Final
-${basedir}/../..
-5.3.2.Final
-3.1.6
-1.2.3
-5.6.0
+0.10
+2.6.0
+3.6.3
+4.4.1
+1.4.9
 2.9.3
 2.7.13
+3.4.13
+
+${basedir}/../..
   
 
   
 
-  
-javax.inject
-javax.inject
-1
-  
-  
-com.netflix.ribbon
-ribbon
-2.2.5
-  
-  
-com.netflix.ribbon
-ribbon-core
-2.2.5
-
-  
-com.google.code.findbugs
-annotations
-  
-
-  
-  
-com.netflix.ribbon
-ribbon-loadbalancer
-2.2.5
-
-  
-com.google.code.findbugs
-annotations
-  
-
-  
-  
-com.netflix.hystrix
-hystrix-core
-1.5.12
-  
+  
   
 ch.qos.logback
 logback-classic
@@ -105,311 +129,352 @@
 logback-core
 ${logback.version}
   
+
   
-junit
-junit
-4.12
-test
+com.101tec
+zkclient
+${tec-zkclient.version}
   
+
   
-org.awaitility
-awaitility
-3.0.0
-test
+com.dyuproject.protostuff
+protostuff-api
+${dyuproject-protostuff.version}
   
   
-com.github.seanyinx
-unit-scaffolding
-1.0.0
-test
+com.dyuproject.protostuff
+protostuff-collectionschema
+${dyuproject-protostuff.version}
   
   
-com.github.tomakehurst
-wiremock-standalone
-2.6.0
-test
+com.dyuproject.protostuff
+protostuff-core
+${dyuproject-protostuff.version}
   
   
-io.reactivex
-rxjava
-1.1.6
+com.dyuproject.protostuff
+protostuff-runtime
+${dyuproject-protostuff.version}
   
+
   
-org.mockito
-mockito-core
-1.10.19
-test
+com.esotericsoftware
+kryo-shaded
+${esotericsoftware.version}
   
+
   
-org.mockito
-mockito-all
-1.10.19
-test
+com.fasterxml.jackson.core
+jackson-annotations
+${jackson.version}
   
   
-org.jmockit
-jmockit
-1.30
-test
+com.fasterxml.jackson.core
+jackson-core
+${jackson.version}
   
   
-org.hamcrest
-hamcrest-core
-1.3
-test
+com.fasterxml.jackson.core
+jackson-databind
+${jackson.version}
   
+
   
-org.hamcrest
-hamcrest-all
-1.3
-test
+com.fasterxml.jackson.dataformat
+jackson-dataformat-protobuf
+${jackson.version

[servicecomb-java-chassis] branch master updated: [SCB-1405] supporting maxWaitQueueSize setting in RestTransportClient (#1282)

2019-07-30 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 1870992  [SCB-1405] supporting maxWaitQueueSize setting in 
RestTransportClient (#1282)
1870992 is described below

commit 1870992bd20f6b9000134f936142971dea0494c4
Author: Ang Li <31733648+ang...@users.noreply.github.com>
AuthorDate: Tue Jul 30 14:56:36 2019 +0800

[SCB-1405] supporting maxWaitQueueSize setting in RestTransportClient 
(#1282)
---
 .../transport/rest/client/RestTransportClient.java | 14 --
 .../transport/rest/client/TransportClientConfig.java   |  7 +++
 .../transport/rest/client/TestTransportClientConfig.java   |  7 +++
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git 
a/transports/transport-rest/transport-rest-client/src/main/java/org/apache/servicecomb/transport/rest/client/RestTransportClient.java
 
b/transports/transport-rest/transport-rest-client/src/main/java/org/apache/servicecomb/transport/rest/client/RestTransportClient.java
index ae7d28d..5d5a927 100644
--- 
a/transports/transport-rest/transport-rest-client/src/main/java/org/apache/servicecomb/transport/rest/client/RestTransportClient.java
+++ 
b/transports/transport-rest/transport-rest-client/src/main/java/org/apache/servicecomb/transport/rest/client/RestTransportClient.java
@@ -75,11 +75,12 @@ public class RestTransportClient {
 
   private static HttpClientOptions createHttpClientOptions() {
 HttpClientOptions httpClientOptions = new HttpClientOptions();
-
httpClientOptions.setMaxPoolSize(TransportClientConfig.getConnectionMaxPoolSize());
-
httpClientOptions.setIdleTimeout(TransportClientConfig.getConnectionIdleTimeoutInSeconds());
-
httpClientOptions.setKeepAlive(TransportClientConfig.getConnectionKeepAlive());
-
httpClientOptions.setTryUseCompression(TransportClientConfig.getConnectionCompression());
-
httpClientOptions.setMaxHeaderSize(TransportClientConfig.getMaxHeaderSize());
+
httpClientOptions.setMaxPoolSize(TransportClientConfig.getConnectionMaxPoolSize())
+
.setIdleTimeout(TransportClientConfig.getConnectionIdleTimeoutInSeconds())
+.setKeepAlive(TransportClientConfig.getConnectionKeepAlive())
+.setTryUseCompression(TransportClientConfig.getConnectionCompression())
+.setMaxHeaderSize(TransportClientConfig.getMaxHeaderSize())
+.setMaxWaitQueueSize(TransportClientConfig.getMaxWaitQueueSize());
 
 VertxTLSBuilder.buildHttpClientOptions(SSL_KEY, httpClientOptions);
 return httpClientOptions;
@@ -93,7 +94,8 @@ public class RestTransportClient {
 
.setIdleTimeout(TransportClientConfig.getHttp2ConnectionIdleTimeoutInSeconds())
 
.setHttp2MultiplexingLimit(TransportClientConfig.getHttp2MultiplexingLimit())
 
.setHttp2MaxPoolSize(TransportClientConfig.getHttp2ConnectionMaxPoolSize())
-
.setTryUseCompression(TransportClientConfig.getConnectionCompression());
+.setTryUseCompression(TransportClientConfig.getConnectionCompression())
+.setMaxWaitQueueSize(TransportClientConfig.getMaxWaitQueueSize());
 
 VertxTLSBuilder.buildHttpClientOptions(SSL_KEY, httpClientOptions);
 return httpClientOptions;
diff --git 
a/transports/transport-rest/transport-rest-client/src/main/java/org/apache/servicecomb/transport/rest/client/TransportClientConfig.java
 
b/transports/transport-rest/transport-rest-client/src/main/java/org/apache/servicecomb/transport/rest/client/TransportClientConfig.java
index f9f7c14..3acb70b 100644
--- 
a/transports/transport-rest/transport-rest-client/src/main/java/org/apache/servicecomb/transport/rest/client/TransportClientConfig.java
+++ 
b/transports/transport-rest/transport-rest-client/src/main/java/org/apache/servicecomb/transport/rest/client/TransportClientConfig.java
@@ -98,4 +98,11 @@ public final class TransportClientConfig {
 .getIntProperty("servicecomb.rest.client.maxHeaderSize", 
HttpClientOptions.DEFAULT_MAX_HEADER_SIZE)
 .get();
   }
+
+  public static int getMaxWaitQueueSize(){
+return DynamicPropertyFactory.getInstance()
+.getIntProperty("servicecomb.rest.client.maxWaitQueueSize",
+HttpClientOptions.DEFAULT_MAX_WAIT_QUEUE_SIZE)
+.get();
+  }
 }
diff --git 
a/transports/transport-rest/transport-rest-client/src/test/java/org/apache/servicecomb/transport/rest/client/TestTransportClientConfig.java
 
b/transports/transport-rest/transport-rest-client/src/test/java/org/apache/servicecomb/transport/rest/client/TestTransportClientConfig.java
index b3debbe..5e27e1e 100644
--- 
a/transports/transport-rest/transport-rest-client/src/test/java/org/apache/servicecomb/transport/rest/client/TestTransportClientConfig.java
+++ 
b/transports/transport-rest/transport-rest-client/src/test/java/org/apache/

[servicecomb-samples] branch master updated (2ed65ad -> f0fbf88)

2019-07-29 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

yaohaishi pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-samples.git.


from 2ed65ad  支持refresh流程
 new 1d80981  new houserush sample framework
 new f0fbf88  reformat code with google java code style and add the Readme 
content

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:
 houserush/README.md|  20 +++
 .../customer-manage}/pom.xml   |  48 ---
 houserush/doc/pom.xml  |  15 ++
 houserush/doc/proposal.md  |  16 +++
 .../gateway-service => houserush/gateway}/pom.xml  |  51 ---
 .../house-order}/pom.xml   |  45 +++---
 .../gateway-service => houserush/login}/pom.xml|  49 ---
 houserush/pom.xml  | 156 +
 .../realestate}/pom.xml|  46 +++---
 .../user-center}/pom.xml   |  38 ++---
 10 files changed, 371 insertions(+), 113 deletions(-)
 create mode 100644 houserush/README.md
 copy {porter_lightweight/gateway-service => houserush/customer-manage}/pom.xml 
(58%)
 create mode 100644 houserush/doc/pom.xml
 create mode 100644 houserush/doc/proposal.md
 copy {porter_lightweight/gateway-service => houserush/gateway}/pom.xml (58%)
 copy {porter_lightweight/gateway-service => houserush/house-order}/pom.xml 
(61%)
 copy {porter_lightweight/gateway-service => houserush/login}/pom.xml (58%)
 create mode 100644 houserush/pom.xml
 copy {porter_lightweight/gateway-service => houserush/realestate}/pom.xml (61%)
 copy {porter_lightweight/gateway-service => houserush/user-center}/pom.xml 
(68%)



[servicecomb-samples] 01/02: new houserush sample framework

2019-07-29 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

yaohaishi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-samples.git

commit 1d8098151bb081276551539e8536d9a3e1b5b8a3
Author: alec.zheng 
AuthorDate: Wed Jul 24 18:23:06 2019 +0800

new houserush sample framework
---
 houserush/README.md   |   2 +
 houserush/customer-manage/pom.xml |  86 +
 houserush/doc/pom.xml |  15 
 houserush/doc/proposal.md |  16 
 houserush/gateway/pom.xml |  76 ++
 houserush/house-order/pom.xml |  70 +
 houserush/login/pom.xml   |  78 +++
 houserush/pom.xml | 157 ++
 houserush/realestate/pom.xml  |  71 +
 houserush/user-center/pom.xml |  63 +++
 10 files changed, 634 insertions(+)

diff --git a/houserush/README.md b/houserush/README.md
new file mode 100644
index 000..105187f
--- /dev/null
+++ b/houserush/README.md
@@ -0,0 +1,2 @@
+TODO
+# houserush todo
diff --git a/houserush/customer-manage/pom.xml 
b/houserush/customer-manage/pom.xml
new file mode 100644
index 000..120d9f1
--- /dev/null
+++ b/houserush/customer-manage/pom.xml
@@ -0,0 +1,86 @@
+
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+  
+houserush
+org.apache.servicecomb.samples.practice
+0.0.1-SNAPSHOT
+  
+  4.0.0
+
+  houserush-customer-manage
+  Java Chassis::Samples::Practice::HouseRush-Customer-Manage
+
+
+
+  
+
+  org.springframework.boot
+  spring-boot-starter
+
+
+
+
+  org.springframework.boot
+  spring-boot-starter-data-jpa
+
+
+
+  org.springframework.boot
+  spring-boot-starter
+
+
+
+  org.apache.servicecomb
+  spring-boot-starter-provider
+
+
+
+  org.apache.servicecomb
+  handler-flowcontrol-qps
+
+
+  org.apache.servicecomb
+  handler-bizkeeper
+
+
+  org.apache.servicecomb
+  handler-tracing-zipkin
+
+
+
+  mysql
+  mysql-connector-java
+
+
+
+
+  
+
+  
+
+  
+org.springframework.boot
+spring-boot-maven-plugin
+  
+
+  
+
+
diff --git a/houserush/doc/pom.xml b/houserush/doc/pom.xml
new file mode 100644
index 000..d153734
--- /dev/null
+++ b/houserush/doc/pom.xml
@@ -0,0 +1,15 @@
+
+http://maven.apache.org/POM/4.0.0;
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+
+houserush
+org.apache.servicecomb.samples.practice
+0.0.1-SNAPSHOT
+
+4.0.0
+
+houserush-doc
+
+
+
\ No newline at end of file
diff --git a/houserush/doc/proposal.md b/houserush/doc/proposal.md
new file mode 100644
index 000..3d228b6
--- /dev/null
+++ b/houserush/doc/proposal.md
@@ -0,0 +1,16 @@
+Hi, All
+
+   Recently, I communicated with some ServiceComb new users, they want an 
e-commerce system ServiceComb sample project with real business background. 
They think with this demo they can learn ServiceComb’s abilities and usages 
**more efficiently**. 
+   
+   Then I found this project https://github.com/apache/servicecomb-samples. So 
I want to develop an e-commerce system demo and **devote** it to  this project 
as this project’s sub-project.
+   
+   ***
+
+   ###The business background of my planing project:
+   Traditionally, a real estate developer in china will show their nearing 
completion buildings to the customers for a couple of days, then determine an 
open sale time for all customers to make real deal offline. Those customers 
have to get to sale place long before the open sale time and queue up,because 
only in this way they get the chances to pick the apartment which they like 
mostly. 
+   So recently, more and more real estate developers begin to build an online 
apartments/houses open sale system. The e-commerce system help their customer 
to pick the houses more easily and more fairly. This is the system which I plan 
to build with ServiceComb.
+
+   ###Why I choose this project as a guiding sample of ServiceComb?
+   Real estate developers use this system to make a deal with their customer 
online. So, yes! This is a real e-commerce system with real commercial value. 
But this is also a real simple e-commerce system which has no payment and 
shipping module. So Its simplicity is good for the guiding purpose. Meanwhile, 
because these trading subjects of this system are very expensive,and there will 
be high QPS when the open sale time just arrives. So There are high 
requirements for the system’s scalab [...]
+   
+   ###Any questions and suggestions?
\ No newline

[servicecomb-samples] 02/02: reformat code with google java code style and add the Readme content

2019-07-29 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

yaohaishi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-samples.git

commit f0fbf8873bd223276d630e62554d193cce877e74
Author: alec.zheng 
AuthorDate: Tue Jul 30 11:21:56 2019 +0800

reformat code with google java code style and add the Readme content
---
 houserush/README.md   |  22 +++-
 houserush/customer-manage/pom.xml |  13 +-
 houserush/doc/pom.xml |  20 +--
 houserush/gateway/pom.xml | 106 
 houserush/house-order/pom.xml |  94 +++---
 houserush/login/pom.xml   | 106 
 houserush/pom.xml | 257 +++---
 houserush/realestate/pom.xml  |  94 +++---
 houserush/user-center/pom.xml |  78 ++--
 9 files changed, 396 insertions(+), 394 deletions(-)

diff --git a/houserush/README.md b/houserush/README.md
index 105187f..57b81ee 100644
--- a/houserush/README.md
+++ b/houserush/README.md
@@ -1,2 +1,20 @@
-TODO
-# houserush todo
+### The business background of my planing project:
+Traditionally, a real estate developer in china will show their nearing 
completion buildings to the customers for a couple of days, then determine an 
open sale time for all customers to make real deal offline. Those customers 
have to get to sale place long before the open sale time and queue up,because 
only in this way they get the chances to pick the apartment which they like 
mostly. 
+So recently, more and more real estate developers begin to build an online 
apartments/houses open sale system. The e-commerce system help their customer 
to pick the houses more easily and more fairly. This is the system which I plan 
to build with ServiceComb.
+
+### Why I choose this project as a guiding sample of ServiceComb?
+Real estate developers use this system to make a deal with their customer 
online. So, yes! This is a real e-commerce system with real commercial value. 
But this is also a real simple e-commerce system which has no payment and 
shipping module. So Its simplicity is good for the guiding purpose. Meanwhile, 
because these trading subjects of this system are very expensive,and there will 
be high QPS when the open sale time just arrives. So There are high 
requirements for the system’s scalabili [...]
+
+### Requirements & Basic Setup
+1. Setup the requirements
+   - setup git, see [git install 
overview](https://git-scm.com/book/zh/v2/%E8%B5%B7%E6%AD%A5-%E5%AE%89%E8%A3%85-Git)
+   - setup JDK 1.8, see [JDK install 
overview](https://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html)
+   - setup Maven 3.x, 详情可参考[Maven install 
guide](https://maven.apache.org/install.html)
+2. Setup and run the service center
+   - setup Docker, see [Docker setup 
guide](https://www.docker.com/get-started)。
+   - input in the terminal $ docker run -d -p 30100:30100 
servicecomb/service-center:latestrun service-center at port 30100
+3. Setup the database
+
+4. check & change the src/main/resources/microservice.yaml and 
src/main/resources/application.yaml configuration file.
+
+5. run each microservice process by mvn spring-boot:run. 
\ No newline at end of file
diff --git a/houserush/customer-manage/pom.xml 
b/houserush/customer-manage/pom.xml
index 120d9f1..bab8767 100644
--- a/houserush/customer-manage/pom.xml
+++ b/houserush/customer-manage/pom.xml
@@ -23,35 +23,29 @@
 org.apache.servicecomb.samples.practice
 0.0.1-SNAPSHOT
   
+
   4.0.0
 
   houserush-customer-manage
   Java Chassis::Samples::Practice::HouseRush-Customer-Manage
 
-
-
   
 
   org.springframework.boot
   spring-boot-starter
 
-
-
 
   org.springframework.boot
   spring-boot-starter-data-jpa
 
-
 
   org.springframework.boot
   spring-boot-starter
 
-
 
   org.apache.servicecomb
   spring-boot-starter-provider
 
-
 
   org.apache.servicecomb
   handler-flowcontrol-qps
@@ -64,14 +58,10 @@
   org.apache.servicecomb
   handler-tracing-zipkin
 
-
 
   mysql
   mysql-connector-java
 
-
-
-
   
 
   
@@ -82,5 +72,4 @@
   
 
   
-
 
diff --git a/houserush/doc/pom.xml b/houserush/doc/pom.xml
index d153734..c3b6486 100644
--- a/houserush/doc/pom.xml
+++ b/houserush/doc/pom.xml
@@ -1,15 +1,15 @@
 
 http://maven.apache.org/POM/4.0.0;
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
-
-houserush
-org.apache.servicecomb.samples.practice
-0.0.1-SNAPSHOT
-
-4.0.0
-
-houserush-doc
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+  
+houserush
+org.apache.servi

[servicecomb-docs] branch master updated (401e3be -> 06ab1ac)

2019-05-29 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

yaohaishi pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-docs.git.


from 401e3be  add more descriptions about handler development
 new 9cdef4c  injectDocumentModification
 new 06ab1ac  InjectDocsMOdify

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:
 java-chassis-reference/en_US/config/inject-config.md | 10 --
 java-chassis-reference/zh_CN/config/inject-config.md |  9 +++--
 2 files changed, 15 insertions(+), 4 deletions(-)



[servicecomb-docs] 01/02: injectDocumentModification

2019-05-29 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

yaohaishi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-docs.git

commit 9cdef4ceb457d31e985a0cc8c2fb4bb8d0646a9f
Author: pengliang 
AuthorDate: Tue May 28 16:55:41 2019 +0800

injectDocumentModification
---
 java-chassis-reference/en_US/config/inject-config.md | 9 +++--
 java-chassis-reference/zh_CN/config/inject-config.md | 9 +++--
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/java-chassis-reference/en_US/config/inject-config.md 
b/java-chassis-reference/en_US/config/inject-config.md
index b44c547..56702e3 100644
--- a/java-chassis-reference/en_US/config/inject-config.md
+++ b/java-chassis-reference/en_US/config/inject-config.md
@@ -63,7 +63,7 @@ We can execute injection with the following sample code:
 Inject configuration properties into objects without `InjectProperties` and 
`InjectProperty` annotations:
 
 ```Java
-ConfigNoAnnotation config = new 
ConfigObjectFactory().create(ConfigNoAnnotation.class);
+ConfigNoAnnotation config = 
priorityPropertyManager.createConfigObject(ConfigNoAnnotation.class);
 ```
 
 Inject configuration properties into objects annotated with `InjectProperties` 
and `InjectProperty`:
@@ -79,7 +79,7 @@ Inject configuration properties into objects annotated with 
`InjectProperties` a
   2.  root.l1-2
 
 ```Java
-ConfigWithAnnotation config = new 
ConfigObjectFactory().create(ConfigWithAnnotation.class,
+ConfigWithAnnotation config = 
priorityPropertyManager.createConfigObject(ConfigWithAnnotation.class,
 "key", "k",
 "low-list", Arrays.asList("low-1", "low-2"),
 "high-list", Arrays.asList("high-1", "high-2"),
@@ -87,5 +87,10 @@ ConfigWithAnnotation config = new 
ConfigObjectFactory().create(ConfigWithAnnotat
);
 ```
 
+Last displayed empty object and empty cache
+```Java
+priorityPropertyManager.unregisterConfigObject(config)
+```
+
 ## Reference resources
 Refer to the sample code: 
https://github.com/apache/servicecomb-java-chassis/blob/master/foundations/foundation-config/src/test/java/org/apache/servicecomb/config/inject/TestConfigObjectFactory.java
diff --git a/java-chassis-reference/zh_CN/config/inject-config.md 
b/java-chassis-reference/zh_CN/config/inject-config.md
index 4dfa330..d9217b7 100644
--- a/java-chassis-reference/zh_CN/config/inject-config.md
+++ b/java-chassis-reference/zh_CN/config/inject-config.md
@@ -59,7 +59,7 @@ public class ConfigNoAnnotation {
 将配置属性注入到无`@InjectProperties`和`@InjectProperty`注解的对象上:
 
 ```Java
-ConfigNoAnnotation config = new 
ConfigObjectFactory().create(ConfigNoAnnotation.class);
+ConfigNoAnnotation config = 
priorityPropertyManager.createConfigObject(ConfigNoAnnotation.class);
 ```
 
 将配置属性注入到有`@InjectProperties`和`@InjectProperty`注解的对象上:
@@ -75,7 +75,7 @@ ConfigNoAnnotation config = new 
ConfigObjectFactory().create(ConfigNoAnnotation.
   2.  root.l1-2
 
 ```Java
-ConfigWithAnnotation config = new 
ConfigObjectFactory().create(ConfigWithAnnotation.class,
+ConfigWithAnnotation config = 
priorityPropertyManager.createConfigObject(ConfigWithAnnotation.class,
 "key", "k",
 "low-list", Arrays.asList("low-1", "low-2"),
 "high-list", Arrays.asList("high-1", "high-2"),
@@ -83,5 +83,10 @@ ConfigWithAnnotation config = new 
ConfigObjectFactory().create(ConfigWithAnnotat
);
 ```
 
+最后不管是有无注解的属性注入,都要显示的回收对象
+```Java
+priorityPropertyManager.unregisterConfigObject(config)
+```
+
 ## 参考
 示例代码请参考: 
https://github.com/apache/servicecomb-java-chassis/blob/master/foundations/foundation-config/src/test/java/org/apache/servicecomb/config/inject/TestConfigObjectFactory.java



[servicecomb-docs] 02/02: InjectDocsMOdify

2019-05-29 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

yaohaishi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-docs.git

commit 06ab1ac886489f3bcc4383fb75d9e97b52fb702f
Author: pengliang 
AuthorDate: Wed May 29 10:35:08 2019 +0800

InjectDocsMOdify
---
 java-chassis-reference/en_US/config/inject-config.md | 7 ---
 java-chassis-reference/zh_CN/config/inject-config.md | 6 +++---
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/java-chassis-reference/en_US/config/inject-config.md 
b/java-chassis-reference/en_US/config/inject-config.md
index 56702e3..64d4fec 100644
--- a/java-chassis-reference/en_US/config/inject-config.md
+++ b/java-chassis-reference/en_US/config/inject-config.md
@@ -63,7 +63,7 @@ We can execute injection with the following sample code:
 Inject configuration properties into objects without `InjectProperties` and 
`InjectProperty` annotations:
 
 ```Java
-ConfigNoAnnotation config = 
priorityPropertyManager.createConfigObject(ConfigNoAnnotation.class);
+ConfigNoAnnotation config = 
SCBEngine.getInstance().getPriorityPropertyManager().createConfigObject(ConfigNoAnnotation.class);
 ```
 
 Inject configuration properties into objects annotated with `InjectProperties` 
and `InjectProperty`:
@@ -79,7 +79,7 @@ Inject configuration properties into objects annotated with 
`InjectProperties` a
   2.  root.l1-2
 
 ```Java
-ConfigWithAnnotation config = 
priorityPropertyManager.createConfigObject(ConfigWithAnnotation.class,
+ConfigWithAnnotation config = 
SCBEngine.getInstance().getPriorityPropertyManager().createConfigObject(ConfigWithAnnotation.class,
 "key", "k",
 "low-list", Arrays.asList("low-1", "low-2"),
 "high-list", Arrays.asList("high-1", "high-2"),
@@ -87,7 +87,8 @@ ConfigWithAnnotation config = 
priorityPropertyManager.createConfigObject(ConfigW
);
 ```
 
-Last displayed empty object and empty cache
+Finally, whether it is an annotation injection or not, you must explicitly 
reclaim the configuration injection object.
+
 ```Java
 priorityPropertyManager.unregisterConfigObject(config)
 ```
diff --git a/java-chassis-reference/zh_CN/config/inject-config.md 
b/java-chassis-reference/zh_CN/config/inject-config.md
index d9217b7..b264230 100644
--- a/java-chassis-reference/zh_CN/config/inject-config.md
+++ b/java-chassis-reference/zh_CN/config/inject-config.md
@@ -59,7 +59,7 @@ public class ConfigNoAnnotation {
 将配置属性注入到无`@InjectProperties`和`@InjectProperty`注解的对象上:
 
 ```Java
-ConfigNoAnnotation config = 
priorityPropertyManager.createConfigObject(ConfigNoAnnotation.class);
+ConfigNoAnnotation config = 
SCBEngine.getInstance().getPriorityPropertyManager().createConfigObject(ConfigNoAnnotation.class);
 ```
 
 将配置属性注入到有`@InjectProperties`和`@InjectProperty`注解的对象上:
@@ -75,7 +75,7 @@ ConfigNoAnnotation config = 
priorityPropertyManager.createConfigObject(ConfigNoA
   2.  root.l1-2
 
 ```Java
-ConfigWithAnnotation config = 
priorityPropertyManager.createConfigObject(ConfigWithAnnotation.class,
+ConfigWithAnnotation config = 
SCBEngine.getInstance().getPriorityPropertyManager().createConfigObject(ConfigWithAnnotation.class,
 "key", "k",
 "low-list", Arrays.asList("low-1", "low-2"),
 "high-list", Arrays.asList("high-1", "high-2"),
@@ -83,7 +83,7 @@ ConfigWithAnnotation config = 
priorityPropertyManager.createConfigObject(ConfigW
);
 ```
 
-最后不管是有无注解的属性注入,都要显示的回收对象
+最后不管是有无注解的属性注入,都要显式地回收配置注入对象
 ```Java
 priorityPropertyManager.unregisterConfigObject(config)
 ```



[servicecomb-java-chassis] branch master updated (d78eee9 -> 1e26958)

2019-05-24 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


from d78eee9  Using the https maven repo
 new 84d8979  [SCB-1274]when service center is unavailable, service should 
enter safe mode.
 new 1e26958  [SCB-1274]when service center is unavailable, service should 
enter safe mode:fix as reviewed

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:
 .../consumer/MicroserviceVersions.java | 39 --
 .../registry/AbstractServiceRegistry.java  |  3 +-
 .../serviceregistry/task/ServiceCenterTask.java| 33 ++-
 ...xceptionEvent.java => SafeModeChangeEvent.java} | 15 ---
 .../task/TestServiceCenterTask.java| 48 +-
 5 files changed, 117 insertions(+), 21 deletions(-)
 copy 
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/task/event/{ExceptionEvent.java
 => SafeModeChangeEvent.java} (76%)



[servicecomb-java-chassis] 01/02: [SCB-1274]when service center is unavailable, service should enter safe mode.

2019-05-24 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit 84d8979302b8994088d0aa3bdd8db804fcad0ed9
Author: heyile <2513931...@qq.com>
AuthorDate: Tue Apr 30 10:40:19 2019 +0800

[SCB-1274]when service center is unavailable, service should enter safe 
mode.
---
 .../consumer/MicroserviceVersions.java | 39 --
 .../registry/AbstractServiceRegistry.java  |  3 +-
 .../serviceregistry/task/ServiceCenterTask.java| 40 +-
 .../task/event/SafeModeChangeEvent.java| 32 +++
 .../task/TestServiceCenterTask.java| 48 +-
 5 files changed, 147 insertions(+), 15 deletions(-)

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/MicroserviceVersions.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/MicroserviceVersions.java
index a870554..16bce48 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/MicroserviceVersions.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/MicroserviceVersions.java
@@ -17,11 +17,11 @@
 
 package org.apache.servicecomb.serviceregistry.consumer;
 
+import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicInteger;
-import java.util.stream.Collectors;
 
 import org.apache.servicecomb.foundation.common.concurrent.ConcurrentHashMapEx;
 import org.apache.servicecomb.foundation.common.utils.SPIServiceUtils;
@@ -34,6 +34,7 @@ import 
org.apache.servicecomb.serviceregistry.config.ServiceRegistryConfig;
 import org.apache.servicecomb.serviceregistry.definition.DefinitionConst;
 import 
org.apache.servicecomb.serviceregistry.task.event.MicroserviceNotExistEvent;
 import 
org.apache.servicecomb.serviceregistry.task.event.PullMicroserviceVersionsInstancesEvent;
+import org.apache.servicecomb.serviceregistry.task.event.SafeModeChangeEvent;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -53,6 +54,9 @@ public class MicroserviceVersions {
 
   private List pulledInstances;
 
+  // in safe mode, instances will never be deleted
+  private boolean safeMode = false;
+
   // instances not always equals to pulledInstances
   // in the future:
   //  pulledInstances means all instance
@@ -193,20 +197,26 @@ public class MicroserviceVersions {
 
   private List mergeInstances(List 
pulledInstances,
   List inUseInstances) {
-List upInstances = pulledInstances
-.stream()
-.collect(Collectors.toList());
+List upInstances = new ArrayList<>(pulledInstances);
+if (safeMode) {
+  // in safe mode, instances will never be deleted
+  upInstances.forEach(instance -> {
+if (!inUseInstances.contains(instance)) {
+  inUseInstances.add(instance);
+}
+  });
+  return inUseInstances;
+}
 if (upInstances.isEmpty() && inUseInstances != null && 
ServiceRegistryConfig.INSTANCE
 .isEmptyInstanceProtectionEnabled()) {
   MicroserviceInstancePing ping = 
SPIServiceUtils.getPriorityHighestService(MicroserviceInstancePing.class);
-  inUseInstances.stream()
-  .forEach(instance -> {
-if (!upInstances.contains(instance)) {
-  if (ping.ping(instance)) {
-upInstances.add(instance);
-  }
-}
-  });
+  inUseInstances.forEach(instance -> {
+if (!upInstances.contains(instance)) {
+  if (ping.ping(instance)) {
+upInstances.add(instance);
+  }
+}
+  });
 }
 return upInstances;
   }
@@ -254,6 +264,11 @@ public class MicroserviceVersions {
 postPullInstanceEvent(0);
   }
 
+  @Subscribe
+  public void onSafeModeChanged(SafeModeChangeEvent modeChangeEvent) {
+this.safeMode = modeChangeEvent.getCurrentMode();
+  }
+
   protected boolean isEventAccept(MicroserviceInstanceChangedEvent 
changedEvent) {
 return (appId.equals(changedEvent.getKey().getAppId()) &&
 microserviceName.equals(changedEvent.getKey().getServiceName())) ||
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/AbstractServiceRegistry.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/AbstractServiceRegistry.java
index 4f65821..c538da6 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/AbstractServiceRegistry.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/AbstractServiceRegistry.java
@@ -200,7 +200,8 @@ public abstract class AbstractServiceRegistry implements 
ServiceRegistry {
   private void createServiceCenterTas

[servicecomb-java-chassis] 02/02: [SCB-1274]when service center is unavailable, service should enter safe mode:fix as reviewed

2019-05-24 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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

commit 1e269582fec7f49b54b72f7df4bef7be8e51b5c0
Author: heyile <2513931...@qq.com>
AuthorDate: Thu May 16 09:22:20 2019 +0800

[SCB-1274]when service center is unavailable, service should enter safe 
mode:fix as reviewed
---
 .../serviceregistry/task/ServiceCenterTask.java   | 15 ---
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/task/ServiceCenterTask.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/task/ServiceCenterTask.java
index 48fa775..170ee3f 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/task/ServiceCenterTask.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/task/ServiceCenterTask.java
@@ -78,24 +78,17 @@ public class ServiceCenterTask implements Runnable {
   if (!safeMode && consecutiveFailedTimes.incrementAndGet() > checkTimes) {
 LOGGER.warn("service center is unavailable, enter safe mode");
 eventBus.post(new SafeModeChangeEvent(true));
+this.safeMode = true;
   }
-  if (consecutiveSucceededTimes.get() != 0) {
-consecutiveSucceededTimes.set(0);
-  }
+  consecutiveSucceededTimes.set(0);
   return;
 }
 if (safeMode && consecutiveSucceededTimes.incrementAndGet() > checkTimes) {
   LOGGER.warn("service center is recovery, exit safe mode");
   eventBus.post(new SafeModeChangeEvent(false));
+  this.safeMode = false;
 }
-if (consecutiveFailedTimes.get() != 0) {
-  consecutiveFailedTimes.set(0);
-}
-  }
-
-  @Subscribe
-  public void onSafeModeChanged(SafeModeChangeEvent modeChangeEvent) {
-safeMode = modeChangeEvent.getCurrentMode();
+consecutiveFailedTimes.set(0);
   }
 
   // messages given in watch error



[servicecomb-java-chassis] branch master updated (c957fc3 -> 89f6ca4)

2019-04-22 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


from c957fc3  [SCB-1088] SDK IsolationServerEvent is missing endpoint 
information
 new 966e4a0  [SCB-1260] make configuration inspector css simpler
 new ee8a916  [SCB-1260] tiny improve PriorityProperty unit test
 new 215042d  [SCB-1260] not refresh page when change schema format and 
tree active node is not schema
 new 89f6ca4  [SCB-1260] fix: inspector online test with servlet.urlPattern 
cause 404

The 2224 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:
 .../config/priority/TestPriorityProperty.java  |  4 +-
 inspector/pom.xml  |  5 ++
 .../inspector/internal/InspectorBootListener.java  |  2 +-
 .../inspector/internal/InspectorImpl.java  | 55 +-
 .../src/main/resources/webroot/static/css/main.css |  1 +
 .../webroot/static/dynamicProperties.html  | 24 +-
 .../webroot/static/priorityProperties.html | 32 ++---
 .../resources/webroot/static/schemas/schemas.js|  4 +-
 .../internal/TestInspectorBootListener.java|  2 +
 .../inspector/internal/TestInspectorImpl.java  | 46 ++
 10 files changed, 111 insertions(+), 64 deletions(-)



[servicecomb-java-chassis] branch master updated: [SCB-1262] change 1.2.0-SNAPSHOT to 1.3.0-SNAPSHOT in pom.xml

2019-04-19 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new dd68583  [SCB-1262] change 1.2.0-SNAPSHOT to 1.3.0-SNAPSHOT in pom.xml
dd68583 is described below

commit dd685837c7fd37f818747c8f014a89d0d7f7e308
Author: wujimin 
AuthorDate: Fri Apr 19 12:55:39 2019 +0800

[SCB-1262] change 1.2.0-SNAPSHOT to 1.3.0-SNAPSHOT in pom.xml
---
 archetypes/business-service-jaxrs/pom.xml  |  2 +-
 .../src/main/resources/archetype-resources/pom.xml |  2 +-
 archetypes/business-service-pojo/pom.xml   |  2 +-
 .../src/main/resources/archetype-resources/pom.xml |  2 +-
 .../business-service-spring-boot-starter/pom.xml   |  2 +-
 .../src/main/resources/archetype-resources/pom.xml |  2 +-
 archetypes/business-service-springmvc/pom.xml  |  2 +-
 .../src/main/resources/archetype-resources/pom.xml |  2 +-
 archetypes/pom.xml |  2 +-
 common/common-javassist/pom.xml|  2 +-
 common/common-protobuf/pom.xml |  2 +-
 common/common-rest/pom.xml |  2 +-
 common/pom.xml |  2 +-
 core/pom.xml   |  2 +-
 coverage-reports/pom.xml   | 56 +++---
 demo/demo-crossapp/crossapp-client/pom.xml |  4 +-
 demo/demo-crossapp/crossapp-server/pom.xml |  4 +-
 demo/demo-crossapp/pom.xml |  2 +-
 demo/demo-edge/authentication/pom.xml  |  2 +-
 demo/demo-edge/business-1-1-0/pom.xml  |  4 +-
 demo/demo-edge/business-1.0.0/pom.xml  |  2 +-
 demo/demo-edge/business-2.0.0/pom.xml  |  4 +-
 demo/demo-edge/consumer/pom.xml|  4 +-
 demo/demo-edge/edge-service/pom.xml|  2 +-
 demo/demo-edge/model/pom.xml   |  2 +-
 demo/demo-edge/pom.xml |  2 +-
 demo/demo-jaxrs/jaxrs-client/pom.xml   |  2 +-
 demo/demo-jaxrs/jaxrs-server/pom.xml   |  2 +-
 demo/demo-jaxrs/pom.xml|  2 +-
 demo/demo-local/pom.xml|  2 +-
 demo/demo-multiple/a-client/pom.xml|  2 +-
 demo/demo-multiple/a-server/pom.xml|  2 +-
 demo/demo-multiple/b-client/pom.xml|  2 +-
 demo/demo-multiple/b-server/pom.xml|  2 +-
 demo/demo-multiple/multiple-client/pom.xml |  2 +-
 demo/demo-multiple/multiple-server/pom.xml |  2 +-
 demo/demo-multiple/pom.xml |  2 +-
 demo/demo-pojo/pojo-client/pom.xml |  2 +-
 demo/demo-pojo/pojo-server/pom.xml |  2 +-
 demo/demo-pojo/pojo-tests/pom.xml  |  2 +-
 demo/demo-pojo/pom.xml |  2 +-
 demo/demo-schema/pom.xml   |  2 +-
 demo/demo-server-servlet/pom.xml   |  2 +-
 demo/demo-signature/pom.xml|  2 +-
 .../demo-spring-boot-discovery-client/pom.xml  |  2 +-
 .../demo-spring-boot-discovery-server/pom.xml  |  4 +-
 .../demo-spring-boot-zuul-proxy/pom.xml|  4 +-
 demo/demo-spring-boot-discovery/pom.xml|  2 +-
 .../demo-spring-boot-jaxrs-client/pom.xml  |  4 +-
 .../demo-spring-boot-jaxrs-server/pom.xml  |  4 +-
 .../demo-spring-boot-springmvc-client/pom.xml  |  2 +-
 .../demo-spring-boot-springmvc-server/pom.xml  |  2 +-
 demo/demo-spring-boot-provider/pom.xml |  2 +-
 .../demo-spring-boot-pojo-client/pom.xml   |  4 +-
 .../demo-spring-boot-pojo-server/pom.xml   |  2 +-
 demo/demo-spring-boot-transport/pom.xml|  2 +-
 demo/demo-springmvc/pom.xml|  2 +-
 demo/demo-springmvc/springmvc-client/pom.xml   |  2 +-
 demo/demo-springmvc/springmvc-server/pom.xml   |  4 +-
 demo/docker-build-config/pom.xml   |  2 +-
 demo/docker-run-config/pom.xml |  2 +-
 demo/perf/pom.xml  |  2 +-
 demo/pom.xml   |  2 +-
 deployment/pom.xml |  2 +-
 dynamic-config/config-apollo/pom.xml   |  2 +-
 dynamic-config/config-cc/pom.xml   |  2 +-
 dynamic-config/pom.xml |  2 +-
 edge/edge-core/pom.xml |  2 +-
 edge/pom.xml   |  2 +-
 foundations/foundation-common/pom.xml  |  2 +-
 foundations/foundation-config/pom.xml  |  2 +-
 foundations/foundation-metrics/pom.xml |  2 +-
 foundations/foundation-protobuf/pom.xml|  2 +-
 foundations/foundation-ssl/pom.xml

[servicecomb-java-chassis] branch master updated: [SCB-1246] EventBus subscriber support order

2019-04-12 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new cbe759e  [SCB-1246] EventBus subscriber support order
cbe759e is described below

commit cbe759ea717f4cafa5b32dc00bdde80d45c11bdf
Author: wujimin 
AuthorDate: Wed Apr 10 15:54:13 2019 +0800

[SCB-1246] EventBus subscriber support order
---
 .../foundation/common/event/SimpleEventBus.java|  5 +++-
 .../foundation/common/event/SimpleSubscriber.java  | 11 
 .../foundation/common/event/SubscriberOrder.java   | 32 ++
 .../foundation/common/event}/TestEventBus.java | 30 ++--
 4 files changed, 75 insertions(+), 3 deletions(-)

diff --git 
a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/SimpleEventBus.java
 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/SimpleEventBus.java
index 1dfbd97..c5a0ac8 100644
--- 
a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/SimpleEventBus.java
+++ 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/SimpleEventBus.java
@@ -18,6 +18,7 @@ package org.apache.servicecomb.foundation.common.event;
 
 import java.lang.reflect.Method;
 import java.util.ArrayList;
+import java.util.Comparator;
 import java.util.List;
 import java.util.Map;
 
@@ -65,7 +66,7 @@ public class SimpleEventBus extends EventBus {
   public void post(Object event) {
 // cache always reset after register/unregister
 // so cache always match latest subscribersMap at last
-// te worst scenes is invoke collectSubscriberForEvent multiple times, no 
problem
+// the worst scenes is invoke collectSubscriberForEvent multiple times, no 
problem
 List subscribers = subscribersCache
 .computeIfAbsent(event.getClass(), this::collectSubscriberForEvent);
 for (SimpleSubscriber subscriber : subscribers) {
@@ -87,6 +88,8 @@ public class SimpleEventBus extends EventBus {
 }
   }
 }
+
+
subscribersForEvent.sort(Comparator.comparingInt(SimpleSubscriber::getOrder));
 return subscribersForEvent;
   }
 }
diff --git 
a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/SimpleSubscriber.java
 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/SimpleSubscriber.java
index 2540250..f18b2fc 100644
--- 
a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/SimpleSubscriber.java
+++ 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/SimpleSubscriber.java
@@ -32,6 +32,8 @@ public class SimpleSubscriber {
 
   private Method method;
 
+  private int order;
+
   // generated from method
   private Consumer lambda;
 
@@ -41,6 +43,11 @@ public class SimpleSubscriber {
 this.instance = instance;
 this.method = method;
 
+SubscriberOrder subscriberOrder = 
method.getAnnotation(SubscriberOrder.class);
+if (subscriberOrder != null) {
+  order = subscriberOrder.value();
+}
+
 method.setAccessible(true);
 try {
   lambda = LambdaMetafactoryUtils.createLambda(instance, method, 
Consumer.class);
@@ -72,6 +79,10 @@ public class SimpleSubscriber {
 return method;
   }
 
+  public int getOrder() {
+return order;
+  }
+
   public void dispatchEvent(Object event) {
 try {
   dispatcher.accept(event);
diff --git 
a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/SubscriberOrder.java
 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/SubscriberOrder.java
new file mode 100644
index 000..2232ac5
--- /dev/null
+++ 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/SubscriberOrder.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.foundation.com

[servicecomb-docs] branch master updated (203d7e5 -> 412c2f2)

2018-11-13 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

yaohaishi pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-docs.git.


from 203d7e5  3rd-party-service-invoke add to SUMMAY.md
 add 1993b82  [SCB-1014] update the description about 
ExceptionToProducerResponseConverter
 add 02cb402  [SCB-1014] rename ExceptionToResponseConverter to 
ExceptionToProducerResponseConverter in other pages
 new 412c2f2  Merge pull request #75 from 
yhs0092/update_ExceptionToProducerResponseConverter_description

The 1 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:
 .../configuration/parameter-validator.md   |  10 +-
 .../en_US/general-development/error-handling.md| 118 +++--
 .../configuration/parameter-validator.md   |  10 +-
 .../zh_CN/general-development/error-handling.md| 112 ++-
 4 files changed, 133 insertions(+), 117 deletions(-)



[servicecomb-docs] 01/01: Merge pull request #75 from yhs0092/update_ExceptionToProducerResponseConverter_description

2018-11-13 Thread yaohaishi
This is an automated email from the ASF dual-hosted git repository.

yaohaishi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-docs.git

commit 412c2f2cbdd74c9f5686c266f822ce5b7efdce7f
Merge: 203d7e5 02cb402
Author: yhs0092 
AuthorDate: Tue Nov 13 17:12:26 2018 +0800

Merge pull request #75 from 
yhs0092/update_ExceptionToProducerResponseConverter_description

[SCB-1014] Update the description about ExceptionToResponseConverter

 .../configuration/parameter-validator.md   |  10 +-
 .../en_US/general-development/error-handling.md| 118 +++--
 .../configuration/parameter-validator.md   |  10 +-
 .../zh_CN/general-development/error-handling.md| 112 ++-
 4 files changed, 133 insertions(+), 117 deletions(-)