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

[incubator-servicecomb-docs] 02/06: update java-chassis-reference/en_US/question-and-answer/interface-compatibility.md

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

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

commit 152f51f684eb61868a7ebb1083151a216125f9bc
Author: DeanLee <li...@huawei.com>
AuthorDate: Mon Aug 20 11:53:53 2018 +0800

    update java-chassis-reference/en_US/question-and-answer/interface-compatibility.md
---
 .../question-and-answer/interface-compatibility.md | 42 +++++++++++-----------
 1 file changed, 20 insertions(+), 22 deletions(-)

diff --git a/java-chassis-reference/en_US/question-and-answer/interface-compatibility.md b/java-chassis-reference/en_US/question-and-answer/interface-compatibility.md
index 2ef0fed..4d11828 100644
--- a/java-chassis-reference/en_US/question-and-answer/interface-compatibility.md
+++ b/java-chassis-reference/en_US/question-and-answer/interface-compatibility.md
@@ -1,39 +1,37 @@
-在进行微服务持续迭代开发的过程中,由于新特性在不停的加入,一些过时的特性在不停的修改,接口兼容问题面临巨大的挑战,特别是在运行环境多版本共存(灰度发布)的情况下。本章节主要描述接口兼容管理的一些实践建议,以及在使用过程中碰到了兼容性问题的解决办法。由于微服务一般都通过REST接口对外提供服务,没有特殊说明的情况下,这里的接口都指REST接口。
+In the process of continuous iterative development of microservices, due to the continuous addition of new features, some old features are continually being modified, and interface compatibility issues face enormous challenges, especially in the running environment multi-version coexistence (grayscale release) ). This chapter mainly describes some practical suggestions for interface compatibility management and solutions to compatibility problems during use. Since microservices generally [...]
 
-# 保证接口兼容的实践
+# Practice of ensuring interface compatibility
 
-为了防止接口兼容问题,开发者在进行接口变更(新增、修改、删除等)的时候,建议遵循下面的一些原则。
+To prevent interface compatibility problems, developers are advised to follow the following principles when making interface changes (add, modify, delete, etc.).
 
-1. 只增加接口,不修改、不删除接口。
-2. 作为Provider,增加接口的时候,相应的将微服务版本号递增。比如将2.1.2修改为2.1.3。
-3. 作为Consumer,使用Provider的新接口时候,指定Provider的最小版本号。比如:servicecomb.references.\[serviceName\].version-rule=2.1.3+,其中serviceName为Provider的微服务名称。
-4. 在服务中心,定期清理不再使用的老版本的微服务信息。
+1. Only add interfaces, do not modify or delete interfaces.
+2. As a Provider, when adding an interface, the microservice version number is incremented accordingly. For example, change 2.1.2 to 2.1.3.
+3. As a Consumer, when using the new interface of the Provider, specify the minimum version number of the Provider. For example: servicecomb.references.\[serviceName\].version-rule=2.1.3+, The serviceName is the Provider's microservice name.
+4. In the service center, regularly clean up the old version of microservice information that is no longer used.
 
-ServiceComb还有如下一些注意事项:
-1. 修改微服务信息,必须升级版本号,因为服务注册的时候,不会覆盖已经注册的微服务信息。
+ServiceComb also has the following considerations:
+1. When modifying the microservice information, you must upgrade the version number, because the service will not overwrite the registered microservice information.
 
-# 接口兼容常见问题及其解决办法
+# interface compatibility common problems and their solutions
 
-开发阶段,由于存在频繁的接口修改,也不会清理服务中心的数据,容易出现调试的时候接口调用失败的情况。建议开发者可以安装下载一个[服务中心的frontend](http://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-service-center/1.0.0-m1/), 可以随时清理服务中心数据。
+During the development phase, due to various interface modification, the data of the service center would not be cleaned up, and the interface call fails when debugging. Developers are advised to install and download a [frontend] of the service center (http://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-service-center/1.0.0-m1/), anytime Clean up service center data.
 
-如果使用华为公有云在线的服务中心,可以直接登录使用微服务引擎提供的管理功能进行删除。
+If you use Huawei's public cloud online service center, you can log in directly using the management functions provided by the microservice engine to delete.
 
-发布阶段,需要审视下接口兼容的实践的步骤,确保不在线上引入接口兼容问题。
+During the release phase, you need to review the steps of the interface-compatible practices to ensure that interface compatibility issues are not online.
 
-如果不小心漏了其中的某个步骤,则可能导致如下一些接口兼容问题:
+If you accidentally miss one of these steps, it may lead to the following interface compatibility issues:
 
-1. 如果修改、删除接口:导致一些老的Consumer将请求路由到新的Provider,调用失败。
-2. 如果忘记修改微服务版本号:导致一些新的Consumer将请求路由到老的Provider,调用失败。
-3. 如果忘记配置Consumer的最小依赖版本:当部署顺序为先停止Consumer,再启动Consumer,再停止Provider,再启动Provider的情况,Consumer无法获取到新接口信息,就采用了老接口,当Provider启动以后,Consumer发起对新接口的调用会失败;或者在Provider没启动前,调用新接口失败等。
+1. If the interface is modified or deleted: some old Consumers will fail to request the new route of the new Provider.
+2. If you forget to modify the microservice version number: some new Consumers will fail to request the route of the old Provider.
+3. If you forget to configure the minimum dependent version of the Consumer: when the deployment order is to stop the Consumer first, then start the Consumer, then stop the Provider, and then start the Provider. The Consumer cannot obtain the new interface information, and the old interface is used. When the Provider starts, The Consumer initiates a call to the new interface that fails; or fails to call the new interface before the Provider started.
 
-出现问题的规避措施:出现的接口兼容问题不同,处理方式会有差异。极端情况,只需要清理Provider、Consumer的微服务信息,然后重启微服务即可。当服务调用关系复杂的情况下,接口兼容问题影响范围会更加广泛,同时清理Provider、Consumer数据会变得复杂,因此建议遵循上面的规范,避免不兼容的情况发生。
+Workarounds for problems: There are different interface compatibility issues and different handling methods. In extreme cases, you only need to clean up the Provider and Consumer microservices, and then restart the microservice. When the service call relationship is complexed, the interface compatibility problem will be more extensive and clean the Provider, and Consumer data will become complicated. Therefore, it is recommended to follow the above specifications to avoid incompatibility.
 
 
 
-# 常见的接口不兼容情况的日志
+# Common interface incompatibility log
 
 * consumer method \[Method Name\] not exist in swagger
 
-可能是Provider增加了接口,但是没有更新版本号。需要删除微服务数据或者更新版本号后重新启动Provider,并重启Consumer。
-
-
+It may be that the Provider has added an interface, but there is no update version number. You need to delete the microservice data or update the version number, restart the Provider, and restart the Consumer.
\ No newline at end of file