You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2018/06/24 00:29:14 UTC

[incubator-servicecomb-website] branch asf-site updated: some improvements for documents (#108)

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

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


The following commit(s) were added to refs/heads/asf-site by this push:
     new 0e78e2b  some improvements for documents (#108)
0e78e2b is described below

commit 0e78e2bfc10137a557aa298c9f06a2c995cac474
Author: SeanL <17...@users.noreply.github.com>
AuthorDate: Sun Jun 24 08:29:12 2018 +0800

    some improvements for documents (#108)
    
    * Update service-configurations.md
    
    1. Modify the incorrect sample code.
    2. Add note on policies' configuration.
    3. Fix Typo.
    
    * Update service-configurations.md
    
    - Modify the incorrect sample code.
    - Add note on policies' configuration.
    - Replace 'cse' with 'servicecomb'.
    - Improve the description of isolation.
    
    * Update quick-start-bmi.md
    
    - Improve translation on service discovery.
    - Fix typo.
    
    * Fix Typo
    
    * Fix typos
    
    * Fix typo
    
    * fix typo
---
 _docs/cn/quick-start-bmi.md         |  4 ++--
 _docs/quick-start-bmi.md            |  6 +++---
 _users/cn/service-configurations.md | 21 +++++++++++++--------
 _users/define-service-contract.md   |  4 ++--
 _users/service-configurations.md    | 18 +++++++++++-------
 5 files changed, 31 insertions(+), 22 deletions(-)

diff --git a/_docs/cn/quick-start-bmi.md b/_docs/cn/quick-start-bmi.md
index 1882ee5..ec7c006 100644
--- a/_docs/cn/quick-start-bmi.md
+++ b/_docs/cn/quick-start-bmi.md
@@ -175,7 +175,7 @@ zuul:
   routes:
     calculator: /calculator/**
 
-# disable netflix eurkea since it's not used for service discovery
+# disable netflix eureka since it's not used for service discovery
 ribbon:
   eureka:
     enabled: false
@@ -194,7 +194,7 @@ servicecomb:
     registry:
       address: http://127.0.0.1:30100
 ```
-此处将服务注册中心和Zuul相结合使能服务发现。
+此处将服务注册中心和Zuul相结合使其能发现服务。
 
 #### 服务启动入口
 服务启动入口也只需要声明启用 `ServiceComb` 和 `Zuul` 即可。
diff --git a/_docs/quick-start-bmi.md b/_docs/quick-start-bmi.md
index 37695d3..6133360 100644
--- a/_docs/quick-start-bmi.md
+++ b/_docs/quick-start-bmi.md
@@ -73,7 +73,7 @@ public class CalculatorServiceImpl implements CalculatorService {
 ```
 
 #### Service endpoint definition
-Service endpoint is defined to generate service contact. First of all, define the endpoint interface:
+Service endpoint is defined to generate service contract. First of all, define the endpoint interface:
 ```java
 public interface CalculatorEndpoint {
   double calculate(double height, double weight);
@@ -110,7 +110,7 @@ public class CalculatorRestEndpoint implements CalculatorEndpoint {
 ServiceComb supports SpringMvc simplified annotations, e.g. `GetMapping`, since version 0.3.0.
 {: .notice--info}
 
-Note that ServiceComb can auto-generate service contract when annotating endpoints with `@RestSchema`. Then configure the endpoint in  `microservice.yaml` as follows to register the contact and microservice to service center.
+Note that ServiceComb can auto-generate service contract when annotating endpoints with `@RestSchema`. Then configure the endpoint in  `microservice.yaml` as follows to register the contract and microservice to service center.
 ```yaml
 APPLICATION_ID: bmi
 service_description:
@@ -175,7 +175,7 @@ zuul:
   routes:
     calculator: /calculator/**
 
-# disable netflix eurkea since it's not used for service discovery
+# disable netflix eureka since it's not used for service discovery
 ribbon:
   eureka:
     enabled: false
diff --git a/_users/cn/service-configurations.md b/_users/cn/service-configurations.md
index 6da4fea..fd531bf 100755
--- a/_users/cn/service-configurations.md
+++ b/_users/cn/service-configurations.md
@@ -24,7 +24,7 @@ redirect_from:
 | 配置项 | 默认值 | 取值范围 | 是否必选 | 含义 | 注意 |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | servicecomb.loadbalance.NFLoadBalancerRuleClassName | com.netflix.loadbalancer.RoundRobinRule | com.netflix.loadbalancer.RoundRobinRule(轮询)com.netflix.loadbalancer.RandomRule(随机)com.netflix.loadbalancer.WeightedResponseTimeRule(服务器响应时间权值)org.apache.servicecomb.loadbalance.SessionStickinessRule(会话保持) | 否 | 负载均衡路由策略 | - |
-| servicecomb.loadbalance.SessionStickinessRule.sessionTimeoutInSeconds | 30 | Integer | 否 | 客户端闲置时间,超过限制后选择后面的服务器。 | 暂不支持微服务配置。e.g. servicecomb.loadbalance.SessionStickinessRule.sessionTimeoutInSeconds,不能配置为cse.loadbalance.DemoService.SessionStickinessRule.sessionTimeoutInSeconds |
+| servicecomb.loadbalance.SessionStickinessRule.sessionTimeoutInSeconds | 30 | Integer | 否 | 客户端闲置时间,超过限制后选择后面的服务器。 | 暂不支持微服务配置。e.g. servicecomb.loadbalance.SessionStickinessRule.sessionTimeoutInSeconds,不能配置为servicecomb.loadbalance.DemoService.SessionStickinessRule.sessionTimeoutInSeconds |
 | servicecomb.loadbalance.SessionStickinessRule.successiveFailedTimes | 5 | Integer | 否 | 客户端失败次数,超过后会切换服务器 | 暂不支持微服务配置 |
 | servicecomb.loadbalance.retryEnabled | FALSE | Boolean | 否 | 负载均衡捕获到服务调用异常,是否进行重试 | - |
 | servicecomb.loadbalance.retryOnNext | 0 | Integer | 否 | 尝试新的服务器的次数 | - |
@@ -122,7 +122,7 @@ servicecomb:
 降级策略是当服务请求异常时,微服务所采用的异常处理策略。降级策略有三个相关的技术概念:“隔离”、“熔断”、“容错”:
 
 降级策略有三个相关的技术概念:“隔离”、“熔断”、“容错”:
-* “隔离”是一种异常检测机制,常用的检测方法是请求超时、流量过大等。一般的设置参数包括超时时间、同时并发请求个数等。
+* “隔离”是一种异常检测机制,常用的检测方法是请求超时、并发量过大等。一般的设置参数包括超时时间、同时并发请求个数等。
 * “熔断”是一种异常反应机制,“熔断”依赖于“隔离”。熔断通常基于错误率来实现。一般的设置参数包括统计请求的个数、错误率等。
 * “容错”是一种异常处理机制,“容错”依赖于“熔断”。熔断以后,会调用“容错”的方法。一般的设置参数包括调用容错方法的次数等。
 
@@ -153,7 +153,7 @@ servicecomb:
 | servicecomb.fallback.maxConcurrentRequests | 10 | - | 否 | 并发调用容错处理措施(servicecomb.fallbackpolicy.policy)的请求数,超过这个值则不再调用处理措施,直接返回异常 |  |
 | servicecomb.fallbackpolicy.policy | throwexception | returnnulll \| throwexception | 否 | 出错后的处理策略 |  |
 
-**注意:** 谨慎使用cse.isolation.timeout.enabled=true。因为系统处理链都是异步执行,中间处理链的返回,会导致后面处理链的逻辑处理效果丢失。尽可能将cse.isolation.timeout.enabled保持默认值false,并且正确设置网络层超时时间cse.request.timeout=30000。
+**注意:** 谨慎使用servicecomb.isolation.timeout.enabled=true。因为系统处理链都是异步执行,中间处理链的返回,会导致后面处理链的逻辑处理效果丢失。尽可能将servicecomb.isolation.timeout.enabled保持默认值false,并且正确设置网络层超时时间servicecomb.request.timeout=30000。
 {: .notice--warning}
 
 ## 示例代码
@@ -170,12 +170,17 @@ servicecomb:
         enabled: true
       timeoutInMilliseconds: 30000
   circuitBreaker:
-    sleepWindowInMilliseconds: 15000
-    requestVolumeThreshold: 20
+    Consumer:
+      sleepWindowInMilliseconds: 15000
+      requestVolumeThreshold: 20
   fallback:
-    enabled: true
-    policy: throwexception
+    Consumer:
+      enabled: true
+  fallbackpolicy:
+    Consumer:
+      policy: throwexception
 ```
 
 > **说明:**
-> 降级策略需要启用服务治理能力,对应的服务提供者的handler是`bizkeeper-provider`,服务消费者的handler是`bizkeeper-consumer`。
+> 
+> 降级策略需要启用服务治理能力,对应的服务提供者的handler是`bizkeeper-provider`,服务消费者的handler是`bizkeeper-consumer`。如果省略了`Consumer:`/`Provider:`,策略将无法配置成功,此时服务治理将以默认配置生效。
diff --git a/_users/define-service-contract.md b/_users/define-service-contract.md
index a98f232..57806c2 100644
--- a/_users/define-service-contract.md
+++ b/_users/define-service-contract.md
@@ -22,7 +22,7 @@ The API definition decouples providers and consumers, which allows the two parti
 
 ### Configuration
 
-ServiceComb defines API in a .yaml faile. You are advised to use [Swagger Editor](http://editor.swagger.io/#/) to write an API definition. This tool can check syntax and automaticlly generate an API document. For details about the API definition file format, see [ Official OpenAPI documentation](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md)。
+ServiceComb defines API in a .yaml file. You are advised to use [Swagger Editor](http://editor.swagger.io/#/) to write an API definition. This tool can check syntax and automaticlly generate an API document. For details about the API definition file format, see [ Official OpenAPI documentation](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md)。
 
 The API definition file is located in "resources/microservices" or "resources/applications" directory. The directory structure is as follows:
 
@@ -113,4 +113,4 @@ definitions:
 
   Implicit API definitions can be used for Spring MVC, JAX-RS, and transparent RPC development modes, For details, see [Development Style-SpringMVC](/users/develop-with-springmvc/), [Development Stype-JAX-RS](/users/develop-with-jax-rs/) and [Development Style-Transparent RPC](/users/develop-with-transparent-rpc/).
 
-  When you develop a microservice in transparent RPC mode, the code does not show how you want to define an API, and all generated APIs are POST methods, The input parameters of all the methods will be packaged as a class and transferred as body parameters. Therefore, if you develop providers using implicit APIs, you are advised to choose Spring MVC or JAX-RS mode to obtain complete RESTful statements.
\ No newline at end of file
+  When you develop a microservice in transparent RPC mode, the code does not show how you want to define an API, and all generated APIs are POST methods, The input parameters of all the methods will be packaged as a class and transferred as body parameters. Therefore, if you develop providers using implicit APIs, you are advised to choose Spring MVC or JAX-RS mode to obtain complete RESTful statements.
diff --git a/_users/service-configurations.md b/_users/service-configurations.md
index 6fb4552..be0b271 100755
--- a/_users/service-configurations.md
+++ b/_users/service-configurations.md
@@ -148,14 +148,14 @@ By configuring a fallback policy, you can handler microservice exceptions.
 | servicecomb.circuitBreaker.enabled               | TRUE           | -                             | No        | Specifies whether to enable fallbreak.   |                                          |
 | servicecomb.circuitBreaker.forceOpen             | FALSE          | -                             | No        | Specifies that fallbreak is enable regardless of the number of failed requests or the error rate. |                                          |
 | servicecomb.circuitBreaker.forceClosed           | FALSE          | -                             | No        | Specifies that fallbreak can be implemented at any time. | If this parameter and servicecomb.circuitBreaker.forceOpen both need to be configured, servicecomb.circuitBreaker.forceOpen has priority. |
-| servicecomb.circuitBreaker.sleepWindowInMilliseconds | 15000          | -                             | No        | Specifies the duration needed to recover from fallbreak. | After the recovery, the number of failed requests will be recalculated. Not: If the consumer fails to send a request to the provider after the recovery, fallbreak is enabled again. |
+| servicecomb.circuitBreaker.sleepWindowInMilliseconds | 15000          | -                             | No        | Specifies the duration needed to recover from fallbreak. | After the recovery, the number of failed requests will be recalculated. Note: If the consumer fails to send a request to the provider after the recovery, fallbreak is enabled again. |
 | servicecomb.circuitBreaker.requestVolumeThreshold | 20             | -                             | No        | Specifies the threshold of failed requests sent within 10 seconds. If the threshold is reached, fallbreak is triggered. | Ten seconds will be divided into ten 1 seconds, and the error rate is calculated 1 second later after an error occurred. Therefore, fallbreak can be implemented at least 1 second after the call. |
 | servicecomb.circuitBreaker.errorThresholdPercentage | 50             | -                             | No        | Specifies the threshold of error rate. If the threshold is reached, fallbreak is triggered. |                                          |
 | servicecomb.fallback.enabled                     | TRUE           | -                             | No        | Specifies whether to enable troubleshooting measures after an error occurred. |                                          |
 | servicecomb.fallback.maxConcurrentRequests       | 10             | -                             | No        | Specifies the number of fault tolerance(servicecomb.fallbackpolicy.policy) requests concurrently called. If the value exceeds 10, the measures will no longer be called, and exception are returned. |                                          |
 | servicecomb.fallbackpolicy.policy                | throwexception | returnnulll \| throwexception | No        | Specifies the error handling policies after an error occurred. |                                          |
 
-**NOTE:** Be cautions when setting servicecomb.isolation.timeout.enabled to TRUE, All processes are asynchronously processed in the system, and any error value returned by an intermediate process because the set timeout duration is reached can cause failure of the follow-up processes. Therefore, you are advised to keep the default value FALSE for servicecomb.isolation.timeout.enabled. For timeout duration from the network aspect, you are advised to set servicecomb.request.timeout=30000.
+**Caution:** Be cautious when setting servicecomb.isolation.timeout.enabled to TRUE, All processes are asynchronously processed in the system, and any error value returned by an intermediate process because the set timeout duration is reached can cause failure of the follow-up processes. Therefore, you are advised to keep the default value FALSE for servicecomb.isolation.timeout.enabled. For timeout duration from the network aspect, you are advised to set servicecomb.request.timeout=30000.
 {: .notice--warning}
 
 ## Sample Code
@@ -172,13 +172,17 @@ servicecomb:
         enabled: true
       timeoutInMilliseconds: 30000
   circuitBreaker:
-    sleepWindowInMilliseconds: 15000
-    requestVolumeThreshold: 20
+    Consumer:
+      sleepWindowInMilliseconds: 15000
+      requestVolumeThreshold: 20
   fallback:
-    enabled: true
-    policy: throwexception
+    Consumer:
+      enabled: true
+  fallbackpolicy:
+    Consumer:
+      policy: throwexception
 ```
 
 > **NOTE:**
 >
-> You need to enable service governance for fallback, The provider handler is bizkeeper-provider, and the consumer handler is bizkeeper-consumer.
+> You need to enable service governance for fallback, The provider handler is `bizkeeper-provider`, and the consumer handler is `bizkeeper-consumer`. If `Consumer:`/`Provider:` was omitted, your configuration would not work, and service governance would be enabled with default configuration.