You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2019/12/13 04:02:10 UTC
[dubbo-website] branch asf-site updated: test doc archive: add doc
sources
This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/dubbo-website.git
The following commit(s) were added to refs/heads/asf-site by this push:
new c54b6bb test doc archive: add doc sources
c54b6bb is described below
commit c54b6bb1b711fcebbecf132fc73cc35c61e1bd72
Author: ken.lj <ke...@gmail.com>
AuthorDate: Fri Dec 13 12:01:53 2019 +0800
test doc archive: add doc sources
---
doc-archive/v2.7.3/docs/zh-cn/admin/LICENSE | 201 ++
doc-archive/v2.7.3/docs/zh-cn/admin/README.md | 1 +
doc-archive/v2.7.3/docs/zh-cn/admin/SUMMARY.md | 5 +
.../docs/zh-cn/admin/install/admin-console.md | 40 +
.../docs/zh-cn/admin/install/consumer-demo.md | 20 +
.../docs/zh-cn/admin/install/introduction.md | 13 +
.../docs/zh-cn/admin/install/provider-demo.md | 18 +
.../v2.7.3/docs/zh-cn/admin/install/redis.md | 54 +
.../zh-cn/admin/install/simple-monitor-center.md | 3 +
.../zh-cn/admin/install/simple-registry-center.md | 2 +
.../v2.7.3/docs/zh-cn/admin/install/zookeeper.md | 98 +
.../v2.7.3/docs/zh-cn/admin/introduction.md | 65 +
doc-archive/v2.7.3/docs/zh-cn/admin/metrics.md | 1 +
.../v2.7.3/docs/zh-cn/admin/ops/dubbo-ops.md | 25 +
.../v2.7.3/docs/zh-cn/admin/ops/introduction.md | 1 +
.../v2.7.3/docs/zh-cn/admin/ops/pinpoint.md | 415 ++++
.../v2.7.3/docs/zh-cn/admin/ops/skywalking.md | 133 ++
.../v2.7.3/docs/zh-cn/admin/serviceGovernance.md | 42 +
.../v2.7.3/docs/zh-cn/admin/serviceSearch.md | 7 +
doc-archive/v2.7.3/docs/zh-cn/admin/serviceTest.md | 1 +
.../docs/zh-cn/admin/sources/images/blackList.jpg | Bin 0 -> 99079 bytes
.../docs/zh-cn/admin/sources/images/config.jpg | Bin 0 -> 137909 bytes
.../docs/zh-cn/admin/sources/images/detail.jpg | Bin 0 -> 188392 bytes
.../admin/sources/images/dubbo-add-config.jpg | Bin 0 -> 303596 bytes
.../zh-cn/admin/sources/images/dubbo-add-route.jpg | Bin 0 -> 330146 bytes
.../admin/sources/images/dubbo-applications.png | Bin 0 -> 93036 bytes
.../zh-cn/admin/sources/images/dubbo-consumers.jpg | Bin 0 -> 274307 bytes
.../admin/sources/images/dubbo-monitor-simple.jpg | Bin 0 -> 87670 bytes
.../zh-cn/admin/sources/images/dubbo-providers.jpg | Bin 0 -> 272674 bytes
.../zh-cn/admin/sources/images/dubbo-search.jpg | Bin 0 -> 224751 bytes
.../admin/sources/images/pinpoint-calltree.png | Bin 0 -> 693731 bytes
.../zh-cn/admin/sources/images/pinpoint-home.png | Bin 0 -> 317984 bytes
.../admin/sources/images/pinpoint-mixedview.png | Bin 0 -> 480963 bytes
.../zh-cn/admin/sources/images/searchResult.png | Bin 0 -> 168461 bytes
.../admin/sources/images/skywalking-alarm.png | Bin 0 -> 181739 bytes
.../sources/images/skywalking-application.png | Bin 0 -> 229539 bytes
.../images/skywalking-application_instance.png | Bin 0 -> 203651 bytes
.../admin/sources/images/skywalking-dashboard.png | Bin 0 -> 257273 bytes
.../sources/images/skywalking-service-consumer.png | Bin 0 -> 282541 bytes
.../sources/images/skywalking-service-provider.png | Bin 0 -> 366038 bytes
.../admin/sources/images/skywalking-span-Info.png | Bin 0 -> 192403 bytes
.../admin/sources/images/skywalking-topology.png | Bin 0 -> 173667 bytes
.../admin/sources/images/skywalking-trace.png | Bin 0 -> 217096 bytes
.../docs/zh-cn/admin/sources/images/weight.jpg | Bin 0 -> 89265 bytes
doc-archive/v2.7.3/docs/zh-cn/dev/LICENSE | 201 ++
doc-archive/v2.7.3/docs/zh-cn/dev/README.md | 1 +
doc-archive/v2.7.3/docs/zh-cn/dev/SPI.md | 237 +++
doc-archive/v2.7.3/docs/zh-cn/dev/SUMMARY.md | 49 +
doc-archive/v2.7.3/docs/zh-cn/dev/TCK.md | 19 +
doc-archive/v2.7.3/docs/zh-cn/dev/build.md | 79 +
doc-archive/v2.7.3/docs/zh-cn/dev/checklist.md | 27 +
doc-archive/v2.7.3/docs/zh-cn/dev/code-smell.md | 205 ++
doc-archive/v2.7.3/docs/zh-cn/dev/coding.md | 53 +
.../v2.7.3/docs/zh-cn/dev/configcenter/design.md | 82 +
doc-archive/v2.7.3/docs/zh-cn/dev/contract.md | 14 +
doc-archive/v2.7.3/docs/zh-cn/dev/contribution.md | 45 +
doc-archive/v2.7.3/docs/zh-cn/dev/design.md | 99 +
.../v2.7.3/docs/zh-cn/dev/implementation.md | 226 +++
doc-archive/v2.7.3/docs/zh-cn/dev/impls/cache.md | 83 +
doc-archive/v2.7.3/docs/zh-cn/dev/impls/cluster.md | 74 +
.../v2.7.3/docs/zh-cn/dev/impls/compiler.md | 55 +
.../v2.7.3/docs/zh-cn/dev/impls/container.md | 62 +
.../v2.7.3/docs/zh-cn/dev/impls/dispatcher.md | 62 +
.../v2.7.3/docs/zh-cn/dev/impls/exchanger.md | 90 +
.../docs/zh-cn/dev/impls/exporter-listener.md | 66 +
.../docs/zh-cn/dev/impls/extension-factory.md | 57 +
doc-archive/v2.7.3/docs/zh-cn/dev/impls/filter.md | 89 +
.../v2.7.3/docs/zh-cn/dev/impls/introduction.md | 3 +
.../docs/zh-cn/dev/impls/invoker-listener.md | 64 +
.../v2.7.3/docs/zh-cn/dev/impls/load-balance.md | 63 +
.../v2.7.3/docs/zh-cn/dev/impls/logger-adapter.md | 84 +
doc-archive/v2.7.3/docs/zh-cn/dev/impls/merger.md | 60 +
doc-archive/v2.7.3/docs/zh-cn/dev/impls/monitor.md | 75 +
.../v2.7.3/docs/zh-cn/dev/impls/networker.md | 59 +
doc-archive/v2.7.3/docs/zh-cn/dev/impls/page.md | 61 +
.../v2.7.3/docs/zh-cn/dev/impls/protocol.md | 151 ++
.../v2.7.3/docs/zh-cn/dev/impls/proxy-factory.md | 65 +
.../v2.7.3/docs/zh-cn/dev/impls/registry.md | 205 ++
.../v2.7.3/docs/zh-cn/dev/impls/remoting.md | 122 ++
doc-archive/v2.7.3/docs/zh-cn/dev/impls/router.md | 58 +
.../v2.7.3/docs/zh-cn/dev/impls/serialize.md | 72 +
.../v2.7.3/docs/zh-cn/dev/impls/status-checker.md | 64 +
.../v2.7.3/docs/zh-cn/dev/impls/telnet-handler.md | 77 +
.../v2.7.3/docs/zh-cn/dev/impls/threadpool.md | 61 +
.../v2.7.3/docs/zh-cn/dev/impls/validation.md | 75 +
doc-archive/v2.7.3/docs/zh-cn/dev/introduction.md | 1 +
.../docs/zh-cn/dev/principals/code-detail.md | 35 +
.../docs/zh-cn/dev/principals/configuration.md | 97 +
.../v2.7.3/docs/zh-cn/dev/principals/dummy.md | 204 ++
.../docs/zh-cn/dev/principals/expansibility.md | 18 +
.../v2.7.3/docs/zh-cn/dev/principals/extension.md | 136 ++
.../docs/zh-cn/dev/principals/general-knowledge.md | 69 +
.../docs/zh-cn/dev/principals/introduction.md | 3 +
.../v2.7.3/docs/zh-cn/dev/principals/robustness.md | 84 +
doc-archive/v2.7.3/docs/zh-cn/dev/release.md | 34 +
.../docs/zh-cn/dev/sources/images/close-expand.jpg | Bin 0 -> 19287 bytes
.../dev/sources/images/configuration-override.png | Bin 0 -> 11422 bytes
.../v2.7.3/docs/zh-cn/dev/sources/images/ddd.jpg | Bin 0 -> 19358 bytes
.../docs/zh-cn/dev/sources/images/design-step1.png | Bin 0 -> 121672 bytes
.../docs/zh-cn/dev/sources/images/design-step2.png | Bin 0 -> 141298 bytes
.../docs/zh-cn/dev/sources/images/design-step3.png | Bin 0 -> 165828 bytes
.../docs/zh-cn/dev/sources/images/design-step4.png | Bin 0 -> 240786 bytes
.../docs/zh-cn/dev/sources/images/dubbo-export.jpg | Bin 0 -> 70132 bytes
.../zh-cn/dev/sources/images/dubbo-extension.jpg | Bin 0 -> 112692 bytes
.../zh-cn/dev/sources/images/dubbo-framework.jpg | Bin 0 -> 219759 bytes
.../zh-cn/dev/sources/images/dubbo-modules.jpg | Bin 0 -> 25411 bytes
.../zh-cn/dev/sources/images/dubbo-protocol.jpg | Bin 0 -> 19340 bytes
.../docs/zh-cn/dev/sources/images/dubbo-refer.jpg | Bin 0 -> 105967 bytes
.../zh-cn/dev/sources/images/dubbo-relation.jpg | Bin 0 -> 30304 bytes
.../dev/sources/images/dubbo_protocol_header.png | Bin 0 -> 74833 bytes
.../zh-cn/dev/sources/images/dubbo_rpc_export.jpg | Bin 0 -> 47624 bytes
.../zh-cn/dev/sources/images/dubbo_rpc_invoke.jpg | Bin 0 -> 45874 bytes
.../zh-cn/dev/sources/images/dubbo_rpc_refer.jpg | Bin 0 -> 50211 bytes
.../zh-cn/dev/sources/images/event-listener.jpg | Bin 0 -> 13192 bytes
.../docs/zh-cn/dev/sources/images/filter-chain.jpg | Bin 0 -> 41029 bytes
.../docs/zh-cn/dev/sources/images/mix-api-spi.jpg | Bin 0 -> 17004 bytes
.../docs/zh-cn/dev/sources/images/open-expand.jpg | Bin 0 -> 10549 bytes
.../zh-cn/dev/sources/images/seperate-api-spi.jpg | Bin 0 -> 23683 bytes
.../committer-guide/apache-dubbo-page_dev.md | 28 +
.../committer-guide/label-an-issue-guide_dev.md | 27 +
.../committer-guide/new-committer-guide_dev.md | 73 +
.../committer-guide/release-guide_dev.md | 464 +++++
.../committer-guide/website-guide_dev.md | 5 +
.../contributor-guide/become-a-committer_dev.md | 3 +
.../contributor-guide/cla-signing-guide_dev.md | 24 +
.../contributor-guide/dubbo-extension-guide_dev.md | 47 +
.../mailing-list-subscription-guide_dev.md | 80 +
.../contributor-guide/new-contributor-guide_dev.md | 36 +
.../reporting-security-issues_dev.md | 21 +
.../software-donation-guide_dev.md | 112 ++
.../contributor-guide/test-coverage-guide_dev.md | 16 +
.../v2.7.3/docs/zh-cn/developers/developers_dev.md | 55 +
.../v2.7.3/docs/zh-cn/developers/guide_dev.md | 82 +
.../docs/zh-cn/developers/user-guide/faq_dev.md | 25 +
.../zh-cn/source_code_guide/adaptive-extension.md | 788 ++++++++
.../v2.7.3/docs/zh-cn/source_code_guide/cluster.md | 606 ++++++
.../docs/zh-cn/source_code_guide/directory.md | 542 ++++++
.../docs/zh-cn/source_code_guide/dubbo-spi.md | 432 +++++
.../docs/zh-cn/source_code_guide/export-service.md | 1518 +++++++++++++++
.../docs/zh-cn/source_code_guide/loadbalance.md | 767 ++++++++
.../docs/zh-cn/source_code_guide/refer-service.md | 899 +++++++++
.../v2.7.3/docs/zh-cn/source_code_guide/router.md | 468 +++++
.../source_code_guide/service-invoking-process.md | 1974 ++++++++++++++++++++
.../source_code_guide/sources/images/cluster.jpg | Bin 0 -> 32874 bytes
.../images/consistent-hash-data-incline.jpg | Bin 0 -> 101943 bytes
.../sources/images/consistent-hash-invoker.jpg | Bin 0 -> 87844 bytes
.../sources/images/consistent-hash.jpg | Bin 0 -> 95740 bytes
.../sources/images/data-format.jpg | Bin 0 -> 115165 bytes
.../sources/images/directory-inherit-hierarchy.png | Bin 0 -> 69024 bytes
.../sources/images/dispatcher-location.jpg | Bin 0 -> 89871 bytes
.../sources/images/dubbo-spi-result.jpg | Bin 0 -> 33007 bytes
.../sources/images/java-spi-result.jpg | Bin 0 -> 46805 bytes
.../sources/images/request-id-application.jpg | Bin 0 -> 217379 bytes
.../sources/images/send-request-process.jpg | Bin 0 -> 83592 bytes
.../sources/images/send-request-thread-stack.jpg | Bin 0 -> 213679 bytes
.../sources/images/service-registry.png | Bin 0 -> 57116 bytes
doc-archive/v2.7.3/docs/zh-cn/user/LICENSE | 201 ++
doc-archive/v2.7.3/docs/zh-cn/user/README.md | 3 +
doc-archive/v2.7.3/docs/zh-cn/user/SUMMARY.md | 109 ++
.../v2.7.3/docs/zh-cn/user/benchmark-tool.md | 28 +
.../v2.7.3/docs/zh-cn/user/best-practice.md | 69 +
.../v2.7.3/docs/zh-cn/user/capacity-plan.md | 23 +
.../docs/zh-cn/user/configuration/annotation.md | 92 +
.../v2.7.3/docs/zh-cn/user/configuration/api.md | 121 ++
.../docs/zh-cn/user/configuration/config-center.md | 153 ++
.../configuration/configuration-load-process.md | 181 ++
.../v2.7.3/docs/zh-cn/user/configuration/index.md | 1 +
.../user/configuration/properties-deprecated.md | 42 +
.../v2.7.3/docs/zh-cn/user/configuration/xml.md | 91 +
doc-archive/v2.7.3/docs/zh-cn/user/coveragence.md | 16 +
.../v2.7.3/docs/zh-cn/user/demos/accesslog.md | 15 +
.../docs/zh-cn/user/demos/async-call-deprecated.md | 57 +
.../v2.7.3/docs/zh-cn/user/demos/async-call.md | 134 ++
.../zh-cn/user/demos/async-execute-on-provider.md | 95 +
.../v2.7.3/docs/zh-cn/user/demos/attachment.md | 30 +
.../docs/zh-cn/user/demos/callback-parameter.md | 112 ++
.../docs/zh-cn/user/demos/concurrency-control.md | 68 +
.../docs/zh-cn/user/demos/config-connections.md | 35 +
.../zh-cn/user/demos/config-rule-deprecated.md | 48 +
.../v2.7.3/docs/zh-cn/user/demos/config-rule.md | 174 ++
.../v2.7.3/docs/zh-cn/user/demos/context.md | 40 +
.../v2.7.3/docs/zh-cn/user/demos/delay-publish.md | 53 +
.../zh-cn/user/demos/distributed-transaction.md | 9 +
doc-archive/v2.7.3/docs/zh-cn/user/demos/dump.md | 18 +
.../v2.7.3/docs/zh-cn/user/demos/echo-service.md | 25 +
.../v2.7.3/docs/zh-cn/user/demos/events-notify.md | 97 +
.../docs/zh-cn/user/demos/explicit-target.md | 41 +
.../zh-cn/user/demos/fault-tolerent-strategy.md | 78 +
.../docs/zh-cn/user/demos/generic-reference.md | 97 +
.../docs/zh-cn/user/demos/generic-service.md | 45 +
.../docs/zh-cn/user/demos/graceful-shutdown.md | 30 +
.../v2.7.3/docs/zh-cn/user/demos/group-merger.md | 54 +
.../docs/zh-cn/user/demos/hostname-binding.md | 58 +
doc-archive/v2.7.3/docs/zh-cn/user/demos/index.md | 1 +
.../v2.7.3/docs/zh-cn/user/demos/introduction.md | 2 +
.../v2.7.3/docs/zh-cn/user/demos/lazy-connect.md | 9 +
.../v2.7.3/docs/zh-cn/user/demos/loadbalance.md | 60 +
.../v2.7.3/docs/zh-cn/user/demos/local-call.md | 46 +
.../v2.7.3/docs/zh-cn/user/demos/local-mock.md | 100 +
.../v2.7.3/docs/zh-cn/user/demos/local-stub.md | 44 +
.../docs/zh-cn/user/demos/logger-strategy.md | 23 +
.../docs/zh-cn/user/demos/multi-protocols.md | 47 +
.../v2.7.3/docs/zh-cn/user/demos/multi-registry.md | 84 +
.../v2.7.3/docs/zh-cn/user/demos/multi-versions.md | 41 +
doc-archive/v2.7.3/docs/zh-cn/user/demos/netty4.md | 35 +
.../docs/zh-cn/user/demos/parameter-validation.md | 183 ++
.../docs/zh-cn/user/demos/preflight-check.md | 55 +
.../zh-cn/user/demos/reference-config-cache.md | 37 +
.../v2.7.3/docs/zh-cn/user/demos/registry-only.md | 17 +
.../v2.7.3/docs/zh-cn/user/demos/result-cache.md | 28 +
.../zh-cn/user/demos/routing-rule-deprecated.md | 193 ++
.../v2.7.3/docs/zh-cn/user/demos/routing-rule.md | 250 +++
.../v2.7.3/docs/zh-cn/user/demos/serialization.md | 80 +
.../docs/zh-cn/user/demos/service-container.md | 61 +
.../docs/zh-cn/user/demos/service-downgrade.md | 18 +
.../v2.7.3/docs/zh-cn/user/demos/service-group.md | 25 +
.../v2.7.3/docs/zh-cn/user/demos/set-host.md | 59 +
.../zh-cn/user/demos/simplify-registry-data.md | 232 +++
.../v2.7.3/docs/zh-cn/user/demos/static-service.md | 25 +
.../v2.7.3/docs/zh-cn/user/demos/stickiness.md | 18 +
.../v2.7.3/docs/zh-cn/user/demos/subscribe-only.md | 19 +
.../v2.7.3/docs/zh-cn/user/demos/thread-model.md | 31 +
.../docs/zh-cn/user/demos/token-authorization.md | 31 +
doc-archive/v2.7.3/docs/zh-cn/user/dependencies.md | 64 +
.../docs/zh-cn/user/languages/erlang/reference.md | 15 +
.../zh-cn/user/languages/erlang/serialization.md | 21 +
.../docs/zh-cn/user/languages/erlang/service.md | 22 +
.../docs/zh-cn/user/languages/erlang/start.md | 60 +
doc-archive/v2.7.3/docs/zh-cn/user/maturity.md | 81 +
doc-archive/v2.7.3/docs/zh-cn/user/perf-test.md | 172 ++
.../v2.7.3/docs/zh-cn/user/preface/architecture.md | 66 +
.../v2.7.3/docs/zh-cn/user/preface/background.md | 20 +
.../v2.7.3/docs/zh-cn/user/preface/index.md | 1 +
.../v2.7.3/docs/zh-cn/user/preface/requirements.md | 13 +
.../v2.7.3/docs/zh-cn/user/preface/usage.md | 39 +
doc-archive/v2.7.3/docs/zh-cn/user/quick-start.md | 138 ++
doc-archive/v2.7.3/docs/zh-cn/user/recommend.md | 171 ++
.../v2.7.3/docs/zh-cn/user/references/api.md | 62 +
.../v2.7.3/docs/zh-cn/user/references/maven.md | 19 +
.../zh-cn/user/references/metadata/introduction.md | 368 ++++
.../user/references/metadata/metadata-redis.md | 1 +
.../user/references/metadata/metadata-zookeeper.md | 1 +
.../docs/zh-cn/user/references/protocol/dubbo.md | 123 ++
.../docs/zh-cn/user/references/protocol/hessian.md | 68 +
.../docs/zh-cn/user/references/protocol/http.md | 57 +
.../zh-cn/user/references/protocol/introduction.md | 3 +
.../zh-cn/user/references/protocol/memcached.md | 44 +
.../docs/zh-cn/user/references/protocol/redis.md | 44 +
.../docs/zh-cn/user/references/protocol/rest.md | 741 ++++++++
.../docs/zh-cn/user/references/protocol/rmi.md | 85 +
.../docs/zh-cn/user/references/protocol/thrift.md | 35 +
.../zh-cn/user/references/protocol/webservice.md | 110 ++
.../v2.7.3/docs/zh-cn/user/references/qos.md | 241 +++
.../zh-cn/user/references/registry/introduction.md | 3 +
.../zh-cn/user/references/registry/multicast.md | 38 +
.../docs/zh-cn/user/references/registry/nacos.md | 130 ++
.../docs/zh-cn/user/references/registry/redis.md | 76 +
.../docs/zh-cn/user/references/registry/simple.md | 49 +
.../zh-cn/user/references/registry/zookeeper.md | 151 ++
.../v2.7.3/docs/zh-cn/user/references/telnet.md | 102 +
.../zh-cn/user/references/xml/dubbo-application.md | 14 +
.../zh-cn/user/references/xml/dubbo-argument.md | 14 +
.../user/references/xml/dubbo-config-center.md | 19 +
.../zh-cn/user/references/xml/dubbo-consumer.md | 24 +
.../docs/zh-cn/user/references/xml/dubbo-method.md | 30 +
.../docs/zh-cn/user/references/xml/dubbo-module.md | 10 +
.../zh-cn/user/references/xml/dubbo-monitor.md | 8 +
.../zh-cn/user/references/xml/dubbo-parameter.md | 22 +
.../zh-cn/user/references/xml/dubbo-protocol.md | 30 +
.../zh-cn/user/references/xml/dubbo-provider.md | 50 +
.../zh-cn/user/references/xml/dubbo-reference.md | 33 +
.../zh-cn/user/references/xml/dubbo-registry.md | 24 +
.../zh-cn/user/references/xml/dubbo-service.md | 37 +
.../docs/zh-cn/user/references/xml/introduction.md | 15 +
doc-archive/v2.7.3/docs/zh-cn/user/rest.md | 1216 ++++++++++++
.../v2.7.3/docs/zh-cn/user/serialization.md | 225 +++
.../v2.7.3/docs/zh-cn/user/simple-monitor.md | 84 +
.../docs/zh-cn/user/sources/images/1kres.png | Bin 0 -> 39384 bytes
.../docs/zh-cn/user/sources/images/1ktps.png | Bin 0 -> 38814 bytes
.../docs/zh-cn/user/sources/images/200kres.png | Bin 0 -> 39229 bytes
.../docs/zh-cn/user/sources/images/200ktps.png | Bin 0 -> 38997 bytes
.../docs/zh-cn/user/sources/images/50kres.png | Bin 0 -> 39733 bytes
.../docs/zh-cn/user/sources/images/50ktps.png | Bin 0 -> 39723 bytes
.../docs/zh-cn/user/sources/images/cluster.jpg | Bin 0 -> 32874 bytes
.../zh-cn/user/sources/images/code-coverage.jpg | Bin 0 -> 141776 bytes
.../zh-cn/user/sources/images/code-dependency.jpg | Bin 0 -> 138868 bytes
.../zh-cn/user/sources/images/code-quality1.jpg | Bin 0 -> 56913 bytes
.../zh-cn/user/sources/images/code-quality5.jpg | Bin 0 -> 41672 bytes
.../zh-cn/user/sources/images/code-tendency.jpg | Bin 0 -> 54729 bytes
.../docs/zh-cn/user/sources/images/context.png | Bin 0 -> 46114 bytes
.../sources/images/dubbo-architecture-future.jpg | Bin 0 -> 55605 bytes
.../sources/images/dubbo-architecture-roadmap.jpg | Bin 0 -> 33931 bytes
.../user/sources/images/dubbo-architecture.jpg | Bin 0 -> 18810 bytes
.../user/sources/images/dubbo-config-override.jpg | Bin 0 -> 68132 bytes
.../zh-cn/user/sources/images/dubbo-config.jpg | Bin 0 -> 69630 bytes
.../zh-cn/user/sources/images/dubbo-directly.jpg | Bin 0 -> 38922 bytes
.../sources/images/dubbo-properties-override.jpg | Bin 0 -> 24590 bytes
.../zh-cn/user/sources/images/dubbo-protocol.jpg | Bin 0 -> 19340 bytes
.../user/sources/images/dubbo-redis-registry.jpg | Bin 0 -> 47205 bytes
.../sources/images/dubbo-service-governance.jpg | Bin 0 -> 67000 bytes
.../docs/zh-cn/user/sources/images/dubbo-token.jpg | Bin 0 -> 17153 bytes
.../docs/zh-cn/user/sources/images/future.jpg | Bin 0 -> 20793 bytes
.../docs/zh-cn/user/sources/images/jta-xa.jpg | Bin 0 -> 37931 bytes
.../zh-cn/user/sources/images/lock-get-bean.jpg | Bin 0 -> 109801 bytes
.../user/sources/images/lock-init-context.jpg | Bin 0 -> 39227 bytes
.../docs/zh-cn/user/sources/images/multicast.jpg | Bin 0 -> 20269 bytes
.../docs/zh-cn/user/sources/images/pojores.png | Bin 0 -> 37733 bytes
.../docs/zh-cn/user/sources/images/pojotps.png | Bin 0 -> 39797 bytes
.../v2.7.3/docs/zh-cn/user/sources/images/rest.jpg | Bin 0 -> 206610 bytes
.../v2.7.3/docs/zh-cn/user/sources/images/rt.png | Bin 0 -> 31098 bytes
.../v2.7.3/docs/zh-cn/user/sources/images/stub.jpg | Bin 0 -> 28646 bytes
.../zh-cn/user/sources/images/subscribe-only.jpg | Bin 0 -> 20626 bytes
...pg-version=1&modificationDate=1326468174000.jpg | Bin 0 -> 20626 bytes
.../v2.7.3/docs/zh-cn/user/sources/images/tps.png | Bin 0 -> 33114 bytes
.../docs/zh-cn/user/sources/images/zookeeper.jpg | Bin 0 -> 31272 bytes
.../v2.7.3/docs/zh-cn/user/versions/index.md | 3 +
.../v2.7.3/docs/zh-cn/user/versions/version-270.md | 282 +++
317 files changed, 24283 insertions(+)
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/LICENSE b/doc-archive/v2.7.3/docs/zh-cn/admin/LICENSE
new file mode 100644
index 0000000..8dada3e
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/admin/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright {yyyy} {name of copyright owner}
+
+ Licensed 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.
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/README.md b/doc-archive/v2.7.3/docs/zh-cn/admin/README.md
new file mode 100644
index 0000000..587ce32
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/admin/README.md
@@ -0,0 +1 @@
+这篇文档详细讲述了 Dubbo Admin的结构,部署方式和功能介绍
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/SUMMARY.md b/doc-archive/v2.7.3/docs/zh-cn/admin/SUMMARY.md
new file mode 100644
index 0000000..d3cfcbb
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/admin/SUMMARY.md
@@ -0,0 +1,5 @@
+* [1 Dubbo Admin介绍](introduction.md)
+ * [1.1 服务搜索和详情](serviceSearch.md)
+ * [1.2 服务治理](serviceGovernance.md)
+ * [1.3 服务测试](serviceTest.md)
+ * [1.4 Metrics统计](metrics.md)
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/install/admin-console.md b/doc-archive/v2.7.3/docs/zh-cn/admin/install/admin-console.md
new file mode 100644
index 0000000..ccac57d
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/admin/install/admin-console.md
@@ -0,0 +1,40 @@
+### 管理控制台安装
+
+目前版本的管理控制台正在开发中,已经完成了服务查询和服务治理的功能,采用前后端分离的模式,具体的安装和使用步骤如下:
+
+安装:
+
+```sh
+git clone https://github.com/apache/dubbo-admin.git /var/tmp/dubbo-admin
+cd /var/tmp/dubbo-admin
+mvn clean package
+```
+
+配置 [^1]:
+
+```sh
+配置文件为:
+dubbo-admin-backend/src/main/resources/application.properties
+主要的配置有:
+dubbo.registry.address=zookeeper://127.0.0.1:2181
+```
+
+启动:
+
+```sh
+mvn --projects dubbo-admin-backend spring-boot:run
+```
+
+其他配置请访问github中的文档:
+
+```sh
+https://github.com/apache/dubbo-admin
+```
+
+访问:
+
+```
+http://127.0.0.1:8080
+```
+
+[^1]: 当前版本中未实现登录功能,会在后续版本加上
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/install/consumer-demo.md b/doc-archive/v2.7.3/docs/zh-cn/admin/install/consumer-demo.md
new file mode 100644
index 0000000..7f1b0dd
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/admin/install/consumer-demo.md
@@ -0,0 +1,20 @@
+
+# 示例消费者安装
+
+安装:
+
+```sh
+git clone https://github.com/apache/dubbo.git
+cd dubbo
+运行 dubbo-demo-consumer中的org.apache.dubbo.demo.consumer.Consumer
+请确保先启动Provider
+如果使用Intellij Idea 请加上-Djava.net.preferIPv4Stack=true
+```
+
+配置:
+
+```sh
+resource/META-INFO.spring/dubbo-demo-consumer.xml
+修改其中的dubbo:registry,替换成Provider提供的注册中心地址
+```
+
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/install/introduction.md b/doc-archive/v2.7.3/docs/zh-cn/admin/install/introduction.md
new file mode 100644
index 0000000..53e8d43
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/admin/install/introduction.md
@@ -0,0 +1,13 @@
+# 安装手册
+
+你可以只运行 Demo Provider 和 Demo Consumer,它们缺省配置为通过 Multicast [^1] 注册中心广播互相发现,建议在不同机器上运行,如果在同一机器上,需设置 `unicast=false`:即: `multicast://224.5.6.7:1234?unicast=false`,否则发给消费者的单播消息可能被提供者抢占,两个消费者在同一台机器也一样,只有 multicast 注册中心有此问题。
+
+你也可以运行多个 Demo Provider 和 Demo Consumer,来验证软负载均衡,Demo Consumer 可以直接启动多个实例,而多个 Demo Provider 因有端口冲突,可在不同机器上运行,或者修改 Demo Provider 安装目录下 `conf/dubbo.properties` 配置中的 `dubbo.protocol.port` 的值。
+
+你也可以增加运行 Simple Monitor 监控中心,它缺省配置为通过 Multicast 注册中心广播发现 Provider 和 Consumer,并展示出它们的依赖关系,以及它们之间调用的次数和时间。
+
+你也可以将 Multicast 注册中心换成 Zookeeper 注册中心,安装 Zookeeper Registry 后,修改 Demo Proivder,Demo Consumer,Simple Monitor 三者安装目录下的 `conf/dubbo.properties`,将 `dubbo.registry.address` 的值改为 `zookeeper://127.0.0.1:2181`,同理,如果换成 Redis Registry,值改为 `redis://127.0.0.1:6379`,如果换成 Simple Registry,值改为 `dubbo://127.0.0.1:9090`
+
+推荐使用 Zookeeper 注册中心
+
+[^1]: 注意:multicast 地址不能配成 127.0.0.1,也不能配成机器的 IP 地址,必须是 D 段广播地址,也就是:224.0.0.0 到 239.255.255.255 之间的任意地址
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/install/provider-demo.md b/doc-archive/v2.7.3/docs/zh-cn/admin/install/provider-demo.md
new file mode 100644
index 0000000..0ca18ad
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/admin/install/provider-demo.md
@@ -0,0 +1,18 @@
+# 示例提供者安装
+
+安装:
+
+```sh
+git clone https://github.com/apache/dubbo.git
+cd dubbo
+运行 dubbo-demo-provider中的org.apache.dubbo.demo.provider.Provider
+如果使用Intellij Idea 请加上-Djava.net.preferIPv4Stack=true
+```
+
+配置:
+
+```sh
+resource/META-INFO.spring/dubbo-demo-provider.xml
+修改其中的dubbo:registry,替换成真实的注册中心地址,推荐使用zookeeper
+```
+
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/install/redis.md b/doc-archive/v2.7.3/docs/zh-cn/admin/install/redis.md
new file mode 100644
index 0000000..b7b518c
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/admin/install/redis.md
@@ -0,0 +1,54 @@
+# Redis 注册中心安装
+
+
+
+Redis [^1] 使用方式参见: [Redis 注册中心参考手册](http://dubbo.apache.org/books/dubbo-user-book/references/registry/redis.html)。
+
+只需搭一个原生的 Redis 服务器,并将[快速启动](http://dubbo.apache.org/books/dubbo-user-book/quick-start.html)中 Provider 和 Consumer 里的 `conf/dubbo.properties` 中的 `dubbo.registry.addrss` 的值改为 `redis://127.0.0.1:6379` 即可使用。
+
+Redis 注册中心集群 [^2] 采用在客户端同时写入多个服务器,读取单个服务器的策略实现。
+
+安装:
+
+```sh
+wget http://redis.googlecode.com/files/redis-2.4.8.tar.gz
+tar xzf redis-2.4.8.tar.gz
+cd redis-2.4.8
+make
+```
+
+配置:
+
+```sh
+vi redis.conf
+```
+
+启动:
+
+```sh
+nohup ./src/redis-server redis.conf &
+```
+
+停止:
+
+```sh
+killall redis-server
+```
+
+* 命令行 [^3]:
+
+```sh
+./src/redis-cli
+hgetall /dubbo/com.foo.BarService/providers
+```
+
+或者:
+
+```sh
+telnet 127.0.0.1 6379
+hgetall /dubbo/com.foo.BarService/providers
+```
+
+[^1]: Redis 是一个高效的 KV 存储服务器,参见:http://redis.io/topics/quickstart
+[^2]: `2.1.0` 以上版本支持
+[^3]: 参见: http://redis.io/commands
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/install/simple-monitor-center.md b/doc-archive/v2.7.3/docs/zh-cn/admin/install/simple-monitor-center.md
new file mode 100644
index 0000000..24799bd
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/admin/install/simple-monitor-center.md
@@ -0,0 +1,3 @@
+# Simple 监控中心安装
+
+#### 不再单独提供监控中心,功能会整合到运维控制台,基于Metrics提供更丰富,实时的信息展示,敬请期待
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/install/simple-registry-center.md b/doc-archive/v2.7.3/docs/zh-cn/admin/install/simple-registry-center.md
new file mode 100644
index 0000000..0c37686
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/admin/install/simple-registry-center.md
@@ -0,0 +1,2 @@
+# Simple 注册中心安装
+
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/install/zookeeper.md b/doc-archive/v2.7.3/docs/zh-cn/admin/install/zookeeper.md
new file mode 100644
index 0000000..1cafbf8
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/admin/install/zookeeper.md
@@ -0,0 +1,98 @@
+# Zookeeper 注册中心安装
+
+建议使用 `dubbo-2.3.3` 以上版本的 zookeeper [^1] 注册中心客户端。
+
+Dubbo 未对 Zookeeper 服务器端做任何侵入修改,只需安装原生的 Zookeeper 服务器即可,所有注册中心逻辑适配都在调用 Zookeeper 客户端时完成。
+
+安装:
+
+```sh
+wget http://archive.apache.org/dist/zookeeper/zookeeper-3.3.3/zookeeper-3.3.3.tar.gz
+tar zxvf zookeeper-3.3.3.tar.gz
+cd zookeeper-3.3.3
+cp conf/zoo_sample.cfg conf/zoo.cfg
+```
+
+配置:
+
+```sh
+vi conf/zoo.cfg
+```
+
+如果不需要集群,`zoo.cfg` 的内容如下 [^2]:
+
+```properties
+tickTime=2000
+initLimit=10
+syncLimit=5
+dataDir=/home/dubbo/zookeeper-3.3.3/data
+clientPort=2181
+```
+
+如果需要集群,`zoo.cfg` 的内容如下 [^3]:
+
+```properties
+tickTime=2000
+initLimit=10
+syncLimit=5
+dataDir=/home/dubbo/zookeeper-3.3.3/data
+clientPort=2181
+server.1=10.20.153.10:2555:3555
+server.2=10.20.153.11:2555:3555
+```
+
+并在 data 目录 [^4] 下放置 myid 文件:
+
+```sh
+mkdir data
+vi myid
+```
+
+myid 指明自己的 id,对应上面 `zoo.cfg` 中 `server.` 后的数字,第一台的内容为 1,第二台的内容为 2,内容如下:
+
+```
+1
+```
+
+启动:
+
+```sh
+./bin/zkServer.sh start
+```
+
+停止:
+
+```sh
+./bin/zkServer.sh stop
+```
+
+命令行 [^5]:
+
+```sh
+telnet 127.0.0.1 2181
+dump
+```
+
+或者:
+
+```shell
+echo dump | nc 127.0.0.1 2181
+```
+
+用法:
+
+```xml
+dubbo.registry.address=zookeeper://10.20.153.10:2181?backup=10.20.153.11:2181
+```
+
+或者:
+
+```xml
+<dubbo:registry protocol="zookeeper" address="10.20.153.10:2181,10.20.153.11:2181" />
+```
+
+[^1]: Zookeeper是 Apache Hadoop 的子项目,强度相对较好,建议生产环境使用该注册中心
+[^2]: 其中 data 目录需改成你真实输出目录
+[^3]: 其中 data 目录和 server 地址需改成你真实部署机器的信息
+[^4]: 上面 `zoo.cfg` 中的 `dataDir`
+[^5]: http://zookeeper.apache.org/doc/r3.3.3/zookeeperAdmin.html
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/introduction.md b/doc-archive/v2.7.3/docs/zh-cn/admin/introduction.md
new file mode 100644
index 0000000..6886ca7
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/admin/introduction.md
@@ -0,0 +1,65 @@
+# Dubbo管理控制台介绍
+目前的管理控制台已经发布0.1版本,结构上采取了前后端分离的方式,前端使用Vue和Vuetify分别作为Javascript框架和UI框架,后端采用Spring Boot框架。既可以按照标准的Maven方式进行打包,部署,也可以采用前后端分离的部署方式,方便开发,功能上,目前具备了服务查询,服务治理(包括Dubbo2.7中新增的治理规则)以及服务测试三部分内容。
+
+### Maven方式部署
+
+* 安装
+```sh
+git clone https://github.com/apache/dubbo-admin.git
+cd dubbo-admin
+mvn clean package
+cd dubbo-admin-distribution/target
+java -jar dubbo-admin-0.1.jar
+```
+* 访问
+http://localhost:8080
+
+
+### 前后端分离部署
+
+* 前端
+```sh
+cd dubbo-admin-ui
+npm run install
+npm run dev
+```
+* 后端
+```sh
+cd dubbo-admin-server
+mvn clean package
+cd target
+java -jar dubbo-admin-server-0.1.jar
+```
+* 访问
+http://localhost:8081
+* 前后端分离模式下,前端的修改可以实时生效
+
+
+### 配置: [^1]
+
+配置文件为:
+```sh
+dubbo-admin-server/src/main/resources/application.properties
+```
+主要的配置有:
+```properties
+admin.config-center=zookeeper://127.0.0.1:2181
+admin.registry.address=zookeeper://127.0.0.1:2181
+admin.metadata-report.address=zookeeper://127.0.0.1:2181
+```
+三个配置项分别指定了配置中心,注册中心和元数据中心的地址,关于这三个中心的详细说明,可以参考[这里](../user/configuration/config-center.md)。
+也可以和Dubbo2.7一样,在配置中心指定元数据和注册中心的地址,以zookeeper为例,配置的路径和内容如下:
+```properties
+# /dubbo/config/dubbo/dubbo.properties
+dubbo.registry.address=zookeeper://127.0.0.1:2181
+dubbo.metadata-report.address=zookeeper://127.0.0.1:2181
+```
+配置中心里的地址会覆盖掉本地`application.properties`的配置
+
+其他配置请访问github中的文档:
+
+```sh
+https://github.com/apache/dubbo-admin
+```
+
+[^1]: 当前版本中未实现登录功能,会在后续版本加上
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/metrics.md b/doc-archive/v2.7.3/docs/zh-cn/admin/metrics.md
new file mode 100644
index 0000000..15b326a
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/admin/metrics.md
@@ -0,0 +1 @@
+在Dubbo 2.7.2及之后的版本中,集成了Metrics服务,新版本的Dubbo Admin也集成了这部分的展示功能,具体用法可参考[这个](https://github.com/apache/dubbo-samples/tree/master/dubbo-samples-metrics)示例:
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/ops/dubbo-ops.md b/doc-archive/v2.7.3/docs/zh-cn/admin/ops/dubbo-ops.md
new file mode 100644
index 0000000..e8df5d9
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/admin/ops/dubbo-ops.md
@@ -0,0 +1,25 @@
+# 管理控制台运维
+
+## 搜索页面
+
+当你需要管理 Dubbo 的服务时,首先要搜索到这个服务,然后打开它的管理页面
+
+
+
+## 服务提供者页面
+
+
+
+## 服务消费者页面
+
+
+
+## 添加路由规则页面
+
+
+
+## 添加动态配置页面
+
+
+
+#####
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/ops/introduction.md b/doc-archive/v2.7.3/docs/zh-cn/admin/ops/introduction.md
new file mode 100644
index 0000000..24561bf
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/admin/ops/introduction.md
@@ -0,0 +1 @@
+# 运维手册
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/ops/pinpoint.md b/doc-archive/v2.7.3/docs/zh-cn/admin/ops/pinpoint.md
new file mode 100644
index 0000000..e7591d3
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/admin/ops/pinpoint.md
@@ -0,0 +1,415 @@
+# 使用Pinpoint做分布式跟踪
+
+在使用Dubbo进行服务化或者整合应用后,假设某个服务后台日志显示有异常,这个服务又被多个应用调用的情况下,我们通常很难判断是哪个应用调用的,问题的起因是什么,因此我们需要一套分布式跟踪系统来快速定位问题,Pinpoint可以帮助我们快速定位问题(当然,解决方案也不止这一种)。
+
+## 什么是Pinpoint(摘自[Pinpoint学习笔记](https://skyao.gitbooks.io/learning-pinpoint/))
+
+[Pinpoint](https://github.com/naver/pinpoint)是一个开源的 APM (Application Performance Management/应用性能管理)工具,用于基于java的大规模分布式系统。
+仿照Google Dapper,Pinpoint通过跟踪分布式应用之间的调用来提供解决方案,以帮助分析系统的总体结构和内部模块之间如何相互联系。
+
+> 注:对于各个模块之间的通讯英文原文中用的是transaction一词,但是我觉得如果翻译为"事务"容易引起误解,所以替换为"交互"或者"调用"这种比较直白的字眼。
+
+在使用上力图简单高效:
+
+* 安装agent,不需要修改哪怕一行代码
+* 最小化性能损失
+
+### 服务器地图(ServerMap)
+
+通过可视化分布式系统的模块和他们之间的相互联系来理解系统拓扑。点击某个节点会展示这个模块的详情,比如它当前的状态和请求数量。
+
+### 实时活动线程图表(Realtime Active Thread Chart)
+
+实时监控应用内部的活动线程。
+
+### 请求/应答分布图表(Request/Response Scatter Chart)
+
+长期可视化请求数量和应答模式来定位潜在问题。通过在图表上拉拽可以选择请求查看更多的详细信息。
+
+### 调用栈(CallStack)
+
+在分布式环境中为每个调用生成代码级别的可视图,在单个视图中定位瓶颈和失败点。
+
+### 巡查(Inspector)
+
+查看应用上的其他详细信息,比如CPU使用率,内存/垃圾回收,TPS,和JVM参数。
+
+### 支持模块
+
+* JDK 6+
+* Tomcat 6/7/8, Jetty 8/9, JBoss EAP 6, Resin 4, Websphere 6/7/8, Vertx 3.3/3.4/3.5
+* Spring, Spring Boot (Embedded Tomcat, Jetty)
+* Apache HTTP Client 3.x/4.x, JDK HttpConnector, GoogleHttpClient, OkHttpClient, NingAsyncHttpClient
+* Thrift Client, Thrift Service, DUBBO PROVIDER, DUBBO CONSUMER
+* ActiveMQ, RabbitMQ
+* MySQL, Oracle, MSSQL, CUBRID,POSTGRESQL, MARIA
+* Arcus, Memcached, Redis, CASSANDRA
+* iBATIS, MyBatis
+* DBCP, DBCP2, HIKARICP
+* gson, Jackson, Json Lib
+* log4j, Logback
+* 自定义模块
+
+## Pinpoint与Dubbo的结合
+
+### 启动Pinpoint
+
+参考Pinpoint的[Quick start](http://naver.github.io/pinpoint/quickstart.html)搭建环境(不需要启动TestApp)
+
+### 准备Dubbo示例程序
+
+#### 创建API包
+
+pom.xml
+```xml
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>com.example</groupId>
+ <artifactId>demo-api</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+</project>
+```
+
+新建API接口:
+```
+package com.example.demoapi;
+
+public interface HelloService {
+ String sayHello(String name);
+}
+```
+
+#### 实现 Dubbo 服务提供方
+
+pom.xml
+```xml
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>com.example</groupId>
+ <artifactId>demo-provider</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <name>demo-provider</name>
+
+ <parent>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-parent</artifactId>
+ <version>2.0.3.RELEASE</version>
+ <relativePath/> <!-- lookup parent from repository -->
+ </parent>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <java.version>1.8</java.version>
+ </properties>
+
+ <repositories>
+ <repository>
+ <id>sonatype-nexus-snapshots</id>
+ <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.alibaba.boot</groupId>
+ <artifactId>dubbo-spring-boot-starter</artifactId>
+ <version>0.2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.example</groupId>
+ <artifactId>demo-api</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
+```
+
+1. 实现 `HelloService` 接口:
+```java
+package com.example.demoprovider.provider;
+
+import org.apache.dubbo.config.annotation.Service;
+import com.example.demoapi.HelloService;
+
+@Service(version = "${demo.service.version}",
+ application = "${dubbo.application.id}",
+ protocol = "${dubbo.protocol.id}",
+ registry = "${dubbo.registry.id}")
+public class HelloServiceImpl implements HelloService {
+ static int i = 0;
+ @Override
+ public String sayHello(String name) {
+ i++;
+ if (i % 3 == 0) {
+ throw new RuntimeException("ex");
+ }
+ return "Hello " + name + "!";
+ }
+}
+```
+
+2. 编写 Spring Boot 引导程序:
+```java
+package com.example.demoprovider;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class DemoProviderApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(DemoProviderApplication.class, args);
+ }
+}
+```
+
+3. 配置 `application.properties`:
+
+```properties
+# Spring boot application
+spring.application.name = dubbo-provider-demo
+server.port = 9090
+management.port = 9091
+
+# Service version
+demo.service.version = 1.0.0
+
+# Base packages to scan Dubbo Components (e.g @Service , @Reference)
+dubbo.scan.basePackages = com.example.demoprovider
+
+# Dubbo Config properties
+## ApplicationConfig Bean
+dubbo.application.id = dubbo-provider-demo
+dubbo.application.name = dubbo-provider-demo
+
+## ProtocolConfig Bean
+dubbo.protocol.id = dubbo
+dubbo.protocol.name = dubbo
+dubbo.protocol.port = 12345
+
+## RegistryConfig Bean
+dubbo.registry.id = my-registry
+dubbo.registry.address = N/A
+```
+
+#### 实现 Dubbo 服务消费方
+
+pom.xml
+```xml
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>com.example</groupId>
+ <artifactId>demo-consumer</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <name>demo-consumer</name>
+
+ <parent>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-parent</artifactId>
+ <version>2.0.3.RELEASE</version>
+ <relativePath/> <!-- lookup parent from repository -->
+ </parent>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <java.version>1.8</java.version>
+ </properties>
+
+ <repositories>
+ <repository>
+ <id>sonatype-nexus-snapshots</id>
+ <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.alibaba.boot</groupId>
+ <artifactId>dubbo-spring-boot-starter</artifactId>
+ <version>0.2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.example</groupId>
+ <artifactId>demo-api</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <configuration>
+ <classifier>exec</classifier>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
+```
+
+1. 通过 `@Reference` 注入 `HelloService`
+```java
+package com.example.democonsumer.controller;
+
+import org.apache.dubbo.config.annotation.Reference;
+import com.example.demoapi.HelloService;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+public class DemoConsumerController {
+ @Reference(version = "${demo.service.version}",
+ application = "${dubbo.application.id}",
+ url = "dubbo://<注意,这里填写具体IP>:12345")
+ private HelloService helloService;
+
+ @RequestMapping("/sayHello")
+ public String sayHello(@RequestParam String name) {
+ return helloService.sayHello(name);
+ }
+}
+```
+> 直连提供者调用需要填写具体IP地址,如果写localhost也可以,但是会被Pinpoint额外识别为一个未知服务
+
+2. 编写 Spring Boot 引导程序(Web 应用):
+```java
+package com.example.democonsumer;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class DemoConsumerApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(DemoConsumerApplication.class, args);
+ }
+}
+```
+
+3. 配置 `application.properties`:
+```properties
+# Spring boot application
+spring.application.name=dubbo-consumer-demo
+server.port=8080
+management.port=8081
+
+# Service Version
+demo.service.version=1.0.0
+
+# Dubbo Config properties
+## ApplicationConfig Bean
+dubbo.application.id=dubbo-consumer-demo
+dubbo.application.name=dubbo-consumer-demo
+
+## ProtocolConfig Bean
+dubbo.protocol.id=dubbo
+dubbo.protocol.name=dubbo
+dubbo.protocol.port=12345
+```
+
+### 使用Pinpoint-agent启动服务提供方和服务消费方
+
+#### 启动服务提供方
+
+1. 编译打包
+```
+mvn clean package
+```
+
+2. 附加参数启动服务提供方
+```
+java -jar -javaagent:$AGENT_PATH/pinpoint-bootstrap-$VERSION.jar -Dpinpoint.agentId=demo-provider -Dpinpoint.applicationName=DP target/demo-provider-0.0.1-SNAPSHOT.jar
+```
+
+3. 附加参数启动服务消费方
+```
+java -jar -javaagent:$AGENT_PATH/pinpoint-bootstrap-$VERSION.jar -Dpinpoint.agentId=demo-consumer -Dpinpoint.applicationName=DC target/demo-comsumer-0.0.1-SNAPSHOT-exec.jar
+```
+
+4. 访问消费方地址模拟用户请求
+
+`http://localhost:8080/sayHello?name=ABC`
+
+## 使用Pinpoint快速定位问题
+
+### 首页
+
+
+
+> 这里的用户请求是请求DubboProvider数量的双倍,原因是记录了favicon.ico图标请求导致的
+
+### 调用树
+
+
+
+### 深入跟踪
+
+
+
+### 其他
+
+示例简单的模拟了Dubbo的提供和调用,并没有进行数据库等其他中间件的应用,详细使用请参照Pinpoint文档。
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/ops/skywalking.md b/doc-archive/v2.7.3/docs/zh-cn/admin/ops/skywalking.md
new file mode 100644
index 0000000..758f3ff
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/admin/ops/skywalking.md
@@ -0,0 +1,133 @@
+# 使用Apache Skywalking (Incubator) 做分布式跟踪
+
+## Apache Skywalking(Incubator)简介
+[Apache Skywalking(Incubator)](https://github.com/apache/incubator-skywalking) 专门为微服务架构和云原生架构系统而设计并且支持分布式链路追踪的APM系统。[Apache Skywalking(Incubator)](https://github.com/apache/incubator-skywalking)通过加载探针的方式收集应用调用链路信息,并对采集的调用链路信息进行分析,生成应用间关系和服务间关系以及服务指标。[Apache Skywalking (Incubating)](https://github.com/apache/incubator-skywalking)目前支持多种语言,其中包括[Java](https://github.com/apache/incubator-skywalking),[.Net Core](https://github.com/OpenSkywalking/skywalking-netcore),[Node.js](https://github.com [...]
+
+目前Skywalking已经支持从6个可视化维度剖析分布式系统的运行情况。总览视图是应用和组件的全局视图,其中包括组件和应用数量,应用的告警波动,慢服务列表以及应用吞吐量;拓扑图从应用依赖关系出发,展现整个应用的拓扑关系;应用视图则是从单个应用的角度,展现应用的上下游关系,TopN的服务和服务器,JVM的相关信息以及对应的主机信息。服务视图关注单个服务入口的运行情况以及此服务的上下游依赖关系,依赖度,帮助用户针对单个服务的优化和监控;调用链展现了调用的单次请求经过的所有埋点以及每个埋点的执行时长;告警视图根据配置阈值针对应用、服务器、服务进行实时告警。
+
+## Dubbo与Apache Skywalking(Incubator)
+### 编写Dubbo示例程序
+Dubbo实例程序已上传到[Github仓库](https://github.com/SkywalkingTest/dubbo-trace-example)中。方便大家下载使用。
+#### API工程
+服务接口:
+
+```
+package org.apache.skywalking.demo.interfaces;
+
+public interface HelloService {
+ String sayHello(String name);
+}
+```
+
+#### Dubbo服务提供工程
+
+```
+package org.apache.skywalking.demo.provider;
+
+@Service(version = "${demo.service.version}",
+ application = "${dubbo.application.id}",
+ protocol = "${dubbo.protocol.id}",
+ registry = "${dubbo.registry.id}", timeout = 60000)
+public class HelloServiceImpl implements HelloService {
+
+ public String sayHello(String name) {
+ LockSupport.parkNanos(TimeUnit.SECONDS.toNanos(1));
+ return "Hello, " + name;
+ }
+
+}
+```
+
+#### Consumer工程
+
+```
+package org.apache.skywalking.demo.consumer;
+
+@RestController
+public class ConsumerController {
+
+ private static int COUNT = 0;
+
+ @Reference(version = "${demo.service.version}",
+ application = "${dubbo.application.id}",
+ url = "dubbo://localhost:20880", timeout = 60000)
+ private HelloService helloService;
+
+ @GetMapping("/sayHello/{name}")
+ public String sayHello(@PathVariable(name = "name") String name) {
+ if ((COUNT++) % 3 == 0){
+ throw new RuntimeException();
+ }
+ LockSupport.parkNanos(TimeUnit.SECONDS.toNanos(2));
+ return helloService.sayHello(name);
+ }
+}
+```
+
+### 部署Apache Skywalking(Incubator)
+Apache Skywalking(Incubator)共提供两种部署模式:单节点模式和集群模式,以下为单节点模式部署步骤,集群模式部署详情参考[文档](https://github.com/apache/incubator-skywalking/blob/master/docs/cn/Deploy-backend-in-cluster-mode-CN.md)。
+#### 依赖第三方组件
+1. JDK8+
+2. Elasticsearch 5.x
+#### 部署步骤
+1. 下载[ Apache Skywalking Collector](http://skywalking.apache.org/downloads/)
+2. 部署ElasticSearch
+ * 修改elasticsearch.yml文件,并设置`cluster.name`设置成`CollectorDBCluster`。此名称需要和collector配置文件一致。
+ * 修改ES配置`network.host`值,将`network.host`的值修改成`0.0.0.0`。
+ * 启动Elasticsearch
+3. 解压并启动Skywalking Collector。运行`bin/startup.sh`命令即可启动Skywalking Collector
+#### 启动示例程序
+在启动示例程序之前,执行编译打包的命令:
+
+```
+./mvnw clean package
+```
+
+#### 启动服务提供端
+
+```
+java -jar -javaagent:$AGENT_PATH/skywalking-agent.jar -Dskywalking.agent.application_code=dubbo-provider -Dskywalking.collector.servers=localhost:10800 dubbo-provider/target/dubbo-provider.jar
+```
+
+#### 启动服务消费端
+
+```
+java -jar -javaagent:$AGENT_PATH/skywalking-agent.jar -Dskywalking.agent.application_code=dubbo-consumer -Dskywalking.collector.servers=localhost:10800 dubbo-consumer/target/dubbo-consumer.jar
+```
+
+#### 访问消费端提供的服务
+
+```
+curl http://localhost:8080/sayHello/test
+```
+
+## Skywalking监控截图:
+
+### 首页
+
+
+### 拓扑图
+
+
+### 应用视图
+
+
+JVM信息
+
+
+### 服务视图
+
+服务消费端:
+
+
+服务提供端:
+
+
+### Trace视图
+
+
+Span信息:
+
+
+### 告警视图
+
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/serviceGovernance.md b/doc-archive/v2.7.3/docs/zh-cn/admin/serviceGovernance.md
new file mode 100644
index 0000000..6f3db55
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/admin/serviceGovernance.md
@@ -0,0 +1,42 @@
+# 服务治理和配置管理
+## 服务治理
+服务治理主要作用是改变运行时服务的行为和选址逻辑,达到限流,权重配置等目的,主要有以下几个功能:
+
+### 应用级别的服务治理
+在Dubbo2.6及更早版本中,所有的服务治理规则都只针对服务粒度,如果要把某条规则作用到应用粒度上,需要为应用下的所有服务配合相同的规则,变更,删除的时候也需要对应的操作,这样的操作很不友好,因此Dubbo2.7版本中增加了应用粒度的服务治理操作,对于条件路由(包括黑白名单),动态配置(包括权重,负载均衡)都可以做应用级别的配置:
+
+上图是条件路由的配置,可以按照应用名,服务名两个维度来填写,也可以按照这两个维度来查询。
+
+### 标签路由
+标签路由是Dubbo2.7引入的新功能,配置以应用作为维度,给不同的服务器打上不同名字的标签,配置如下图所示:
+
+调用的时候,客户端可以通过`setAttachment`的方式,来设置不同的标签名称,比如本例中,`setAttachment(tag1)`,客户端的选址范围就在如图所示的三台机器中,可以通过这种方式来实现流量隔离,灰度发布等功能。
+
+### 条件路由
+条件路由是Dubbo一直以来就有的功能,目前可以配置服务和应用两个维度,条件路由为`yaml`格式,具体的规则体以及各种适用场景,请参考[这里](../user/demos/routing-rule.md)
+
+### 黑白名单
+黑白名单是条件路由的一部分,规则存储和条件路由放在一起,为了方便配置所以单独拿出来,同样可以通过服务和应用两个维度,指定黑名单和白名单:
+
+
+### 动态配置
+动态配置是和路由规则平行的另一类服务治理治理功能,主要作用是在不重启服务的情况下,动态改变调用行为,从Dubbo2.7版本开始,支持服务和应用两个维度的配置,采用`yaml`格式,界面如下:
+
+具体的规则体说明请参考[这里](../user/demos/config-rule.md)
+
+### 权重调节
+权重调节是动态配置的子功能,主要作用是改变服务端的权重,更大的权重会有更大的几率被客户端选中作为服务提供者,从而达到流量分配的目的:
+
+
+### 负载均衡
+负载均衡也是动态配置的子功能,主要作用是调整客户端的选址逻辑,目前可选的负载均衡策略有随机,轮训和最小活跃,关于各个策略的解释请参考[这里](../user/demos/loadbalance.md)
+
+## 配置管理
+配置管理也是配合Dubbo2.7新增的功能,在Dubbo2.7中,增加了全局和应用维度的配置,分别在全局和应用范围内生效,其中应用配置也可以指定该应用中的服务级别的配置,可以在控制台中查看,修改配置规则,默认展示全局维度的配置。
+* 全局配置:
+
+全局配置里可以指定注册中心,元数据中心的地址,服务端和客户端的超时时间等,这些配置在全局内生效。除了配置写入,也可以用来查看。如果使用zookeeper作为注册中心和元数据中心,还可以看到配置文件所在位置的目录结构。
+* 应用, 服务配置
+
+应用级别的配置可以为应用或者应用内的服务指定配置,在服务维度上,需要区分提供者和消费者。`dubbo.reference.{serviceName}`表示作为该服务消费者的配置,`dubbo.provider.{servcieName}`表示作为该服务提供者的配置。其中注册中心和元数据中心的地址,只能在全局配置中指定,这也是Dubbo2.7中推荐的使用方式。
+* 优先级: 服务配置 > 应用配置 > 全局配置
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/serviceSearch.md b/doc-archive/v2.7.3/docs/zh-cn/admin/serviceSearch.md
new file mode 100644
index 0000000..355975b
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/admin/serviceSearch.md
@@ -0,0 +1,7 @@
+# 服务查询和详情展示
+服务查询是Dubbo OPS最基本的功能,目前支持服务,应用和IP三个维度的查询,并且服务和应用支持模糊查询和自动提示:
+
+其中详情页展示了服务提供者,消费者等信息,元数据信息需要在Dubbo2.7及之后的版本才会展示:
+
+
+
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/serviceTest.md b/doc-archive/v2.7.3/docs/zh-cn/admin/serviceTest.md
new file mode 100644
index 0000000..852d1bf
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/admin/serviceTest.md
@@ -0,0 +1 @@
+请参考这篇[博客](../../../blog/zh-cn/service-test.md)
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/blackList.jpg b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/blackList.jpg
new file mode 100644
index 0000000..9f59e9f
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/blackList.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/config.jpg b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/config.jpg
new file mode 100644
index 0000000..e11dd9a
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/config.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/detail.jpg b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/detail.jpg
new file mode 100644
index 0000000..68daa39
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/detail.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/dubbo-add-config.jpg b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/dubbo-add-config.jpg
new file mode 100644
index 0000000..bbee7d7
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/dubbo-add-config.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/dubbo-add-route.jpg b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/dubbo-add-route.jpg
new file mode 100644
index 0000000..48edfcd
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/dubbo-add-route.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/dubbo-applications.png b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/dubbo-applications.png
new file mode 100644
index 0000000..60a95e9
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/dubbo-applications.png differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/dubbo-consumers.jpg b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/dubbo-consumers.jpg
new file mode 100644
index 0000000..08f92b6
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/dubbo-consumers.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/dubbo-monitor-simple.jpg b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/dubbo-monitor-simple.jpg
new file mode 100644
index 0000000..66967e5
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/dubbo-monitor-simple.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/dubbo-providers.jpg b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/dubbo-providers.jpg
new file mode 100644
index 0000000..0005d86
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/dubbo-providers.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/dubbo-search.jpg b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/dubbo-search.jpg
new file mode 100644
index 0000000..7795905
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/dubbo-search.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/pinpoint-calltree.png b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/pinpoint-calltree.png
new file mode 100644
index 0000000..c079cb8
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/pinpoint-calltree.png differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/pinpoint-home.png b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/pinpoint-home.png
new file mode 100644
index 0000000..fb61e04
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/pinpoint-home.png differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/pinpoint-mixedview.png b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/pinpoint-mixedview.png
new file mode 100644
index 0000000..cea9e5e
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/pinpoint-mixedview.png differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/searchResult.png b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/searchResult.png
new file mode 100644
index 0000000..7f5bd63
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/searchResult.png differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-alarm.png b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-alarm.png
new file mode 100644
index 0000000..7c19a64
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-alarm.png differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-application.png b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-application.png
new file mode 100644
index 0000000..76fce2c
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-application.png differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-application_instance.png b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-application_instance.png
new file mode 100644
index 0000000..86353f5
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-application_instance.png differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-dashboard.png b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-dashboard.png
new file mode 100644
index 0000000..5d844fa
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-dashboard.png differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-service-consumer.png b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-service-consumer.png
new file mode 100644
index 0000000..7ab5237
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-service-consumer.png differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-service-provider.png b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-service-provider.png
new file mode 100644
index 0000000..fde08e3
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-service-provider.png differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-span-Info.png b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-span-Info.png
new file mode 100644
index 0000000..cb0ff74
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-span-Info.png differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-topology.png b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-topology.png
new file mode 100644
index 0000000..934d170
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-topology.png differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-trace.png b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-trace.png
new file mode 100644
index 0000000..90add82
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/skywalking-trace.png differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/weight.jpg b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/weight.jpg
new file mode 100644
index 0000000..ec4eb2e
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/admin/sources/images/weight.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/LICENSE b/doc-archive/v2.7.3/docs/zh-cn/dev/LICENSE
new file mode 100644
index 0000000..8dada3e
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright {yyyy} {name of copyright owner}
+
+ Licensed 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.
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/README.md b/doc-archive/v2.7.3/docs/zh-cn/dev/README.md
new file mode 100644
index 0000000..15002e4
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/README.md
@@ -0,0 +1 @@
+这篇文档的目标读者是对 dubbo 源码、设计有兴趣的,或者有意愿加入 dubbo 开发的人群。主要涵盖了 dubbo 的框架设计、扩展机制、编码规范、版本管理、构建等话题。
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/SPI.md b/doc-archive/v2.7.3/docs/zh-cn/dev/SPI.md
new file mode 100644
index 0000000..4f3927b
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/SPI.md
@@ -0,0 +1,237 @@
+# 扩展点加载
+
+## 扩展点配置
+
+### 来源:
+
+Dubbo 的扩展点加载从 JDK 标准的 SPI (Service Provider Interface) 扩展点发现机制加强而来。
+
+Dubbo 改进了 JDK 标准的 SPI 的以下问题:
+
+* JDK 标准的 SPI 会一次性实例化扩展点所有实现,如果有扩展实现初始化很耗时,但如果没用上也加载,会很浪费资源。
+* 如果扩展点加载失败,连扩展点的名称都拿不到了。比如:JDK 标准的 ScriptEngine,通过 `getName()` 获取脚本类型的名称,但如果 RubyScriptEngine 因为所依赖的 jruby.jar 不存在,导致 RubyScriptEngine 类加载失败,这个失败原因被吃掉了,和 ruby 对应不起来,当用户执行 ruby 脚本时,会报不支持 ruby,而不是真正失败的原因。
+* 增加了对扩展点 IoC 和 AOP 的支持,一个扩展点可以直接 setter 注入其它扩展点。
+
+### 约定:
+
+在扩展类的 jar 包内 [^1],放置扩展点配置文件 `META-INF/dubbo/接口全限定名`,内容为:`配置名=扩展实现类全限定名`,多个实现类用换行符分隔。
+
+### 示例:
+
+以扩展 Dubbo 的协议为例,在协议的实现 jar 包内放置文本文件:`META-INF/dubbo/org.apache.dubbo.rpc.Protocol`,内容为:
+
+```properties
+xxx=com.alibaba.xxx.XxxProtocol
+```
+
+实现类内容 [^2]:
+
+```java
+package com.alibaba.xxx;
+
+import org.apache.dubbo.rpc.Protocol;
+
+public class XxxProtocol implements Protocol {
+ // ...
+}
+```
+
+### 配置模块中的配置
+
+Dubbo 配置模块中,扩展点均有对应配置属性或标签,通过配置指定使用哪个扩展实现。比如:
+
+```xml
+<dubbo:protocol name="xxx" />
+```
+
+## 扩展点特性
+
+### 扩展点自动包装
+
+自动包装扩展点的 Wrapper 类。`ExtensionLoader` 在加载扩展点时,如果加载到的扩展点有拷贝构造函数,则判定为扩展点 Wrapper 类。
+
+Wrapper类内容:
+
+```java
+package com.alibaba.xxx;
+
+import org.apache.dubbo.rpc.Protocol;
+
+public class XxxProtocolWrapper implements Protocol {
+ Protocol impl;
+
+ public XxxProtocolWrapper(Protocol protocol) { impl = protocol; }
+
+ // 接口方法做一个操作后,再调用extension的方法
+ public void refer() {
+ //... 一些操作
+ impl.refer();
+ // ... 一些操作
+ }
+
+ // ...
+}
+```
+
+Wrapper 类同样实现了扩展点接口,但是 Wrapper 不是扩展点的真正实现。它的用途主要是用于从 `ExtensionLoader` 返回扩展点时,包装在真正的扩展点实现外。即从 `ExtensionLoader` 中返回的实际上是 Wrapper 类的实例,Wrapper 持有了实际的扩展点实现类。
+
+扩展点的 Wrapper 类可以有多个,也可以根据需要新增。
+
+通过 Wrapper 类可以把所有扩展点公共逻辑移至 Wrapper 中。新加的 Wrapper 在所有的扩展点上添加了逻辑,有些类似 AOP,即 Wrapper 代理了扩展点。
+
+### 扩展点自动装配
+
+加载扩展点时,自动注入依赖的扩展点。加载扩展点时,扩展点实现类的成员如果为其它扩展点类型,`ExtensionLoader` 在会自动注入依赖的扩展点。`ExtensionLoader` 通过扫描扩展点实现类的所有 setter 方法来判定其成员。即 `ExtensionLoader` 会执行扩展点的拼装操作。
+
+示例:有两个为扩展点 `CarMaker`(造车者)、`WheelMaker` (造轮者)
+
+接口类如下:
+
+```java
+public interface CarMaker {
+ Car makeCar();
+}
+
+public interface WheelMaker {
+ Wheel makeWheel();
+}
+```
+
+`CarMaker` 的一个实现类:
+
+```java
+public class RaceCarMaker implements CarMaker {
+ WheelMaker wheelMaker;
+
+ public setWheelMaker(WheelMaker wheelMaker) {
+ this.wheelMaker = wheelMaker;
+ }
+
+ public Car makeCar() {
+ // ...
+ Wheel wheel = wheelMaker.makeWheel();
+ // ...
+ return new RaceCar(wheel, ...);
+ }
+}
+```
+
+`ExtensionLoader` 加载 `CarMaker` 的扩展点实现 `RaceCarMaker` 时,`setWheelMaker` 方法的 `WheelMaker` 也是扩展点则会注入 `WheelMaker` 的实现。
+
+这里带来另一个问题,`ExtensionLoader` 要注入依赖扩展点时,如何决定要注入依赖扩展点的哪个实现。在这个示例中,即是在多个`WheelMaker` 的实现中要注入哪个。
+
+这个问题在下面一点 [扩展点自适应](#扩展点自适应) 中说明。
+
+### 扩展点自适应
+
+`ExtensionLoader` 注入的依赖扩展点是一个 `Adaptive` 实例,直到扩展点方法执行时才决定调用是一个扩展点实现。
+
+Dubbo 使用 URL 对象(包含了Key-Value)传递配置信息。
+
+扩展点方法调用会有URL参数(或是参数有URL成员)
+
+这样依赖的扩展点也可以从URL拿到配置信息,所有的扩展点自己定好配置的Key后,配置信息从URL上从最外层传入。URL在配置传递上即是一条总线。
+
+示例:有两个为扩展点 `CarMaker`、`WheelMaker`
+
+接口类如下:
+
+```java
+public interface CarMaker {
+ Car makeCar(URL url);
+}
+
+public interface WheelMaker {
+ Wheel makeWheel(URL url);
+}
+```
+
+`CarMaker` 的一个实现类:
+
+```java
+public class RaceCarMaker implements CarMaker {
+ WheelMaker wheelMaker;
+
+ public setWheelMaker(WheelMaker wheelMaker) {
+ this.wheelMaker = wheelMaker;
+ }
+
+ public Car makeCar(URL url) {
+ // ...
+ Wheel wheel = wheelMaker.makeWheel(url);
+ // ...
+ return new RaceCar(wheel, ...);
+ }
+}
+```
+
+当上面执行
+
+```java
+// ...
+Wheel wheel = wheelMaker.makeWheel(url);
+// ...
+```
+
+时,注入的 `Adaptive` 实例可以提取约定 Key 来决定使用哪个 `WheelMaker` 实现来调用对应实现的真正的 `makeWheel` 方法。如提取 `wheel.type`, key 即 `url.get("wheel.type")` 来决定 `WheelMake` 实现。`Adaptive` 实例的逻辑是固定,指定提取的 URL 的 Key,即可以代理真正的实现类上,可以动态生成。
+
+在 Dubbo 的 `ExtensionLoader` 的扩展点类对应的 `Adaptive` 实现是在加载扩展点里动态生成。指定提取的 URL 的 Key 通过 `@Adaptive` 注解在接口方法上提供。
+
+下面是 Dubbo 的 Transporter 扩展点的代码:
+
+```java
+public interface Transporter {
+ @Adaptive({"server", "transport"})
+ Server bind(URL url, ChannelHandler handler) throws RemotingException;
+
+ @Adaptive({"client", "transport"})
+ Client connect(URL url, ChannelHandler handler) throws RemotingException;
+}
+```
+
+对于 bind() 方法,Adaptive 实现先查找 `server` key,如果该 Key 没有值则找 `transport` key 值,来决定代理到哪个实际扩展点。
+
+
+### 扩展点自动激活
+
+对于集合类扩展点,比如:`Filter`, `InvokerListener`, `ExportListener`, `TelnetHandler`, `StatusChecker` 等,可以同时加载多个实现,此时,可以用自动激活来简化配置,如:
+
+```java
+import org.apache.dubbo.common.extension.Activate;
+import org.apache.dubbo.rpc.Filter;
+
+@Activate // 无条件自动激活
+public class XxxFilter implements Filter {
+ // ...
+}
+```
+
+或:
+
+```java
+import org.apache.dubbo.common.extension.Activate;
+import org.apache.dubbo.rpc.Filter;
+
+@Activate("xxx") // 当配置了xxx参数,并且参数为有效值时激活,比如配了cache="lru",自动激活CacheFilter。
+public class XxxFilter implements Filter {
+ // ...
+}
+```
+
+或:
+
+```java
+import org.apache.dubbo.common.extension.Activate;
+import org.apache.dubbo.rpc.Filter;
+
+@Activate(group = "provider", value = "xxx") // 只对提供方激活,group可选"provider"或"consumer"
+public class XxxFilter implements Filter {
+ // ...
+}
+```
+
+
+[^1]: 注意:这里的配置文件是放在你自己的 jar 包内,不是 dubbo 本身的 jar 包内,Dubbo 会全 ClassPath 扫描所有 jar 包内同名的这个文件,然后进行合并
+[^2]: 注意:扩展点使用单一实例加载(请确保扩展实现的线程安全性),缓存在 `ExtensionLoader` 中
+
+
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/SUMMARY.md b/doc-archive/v2.7.3/docs/zh-cn/dev/SUMMARY.md
new file mode 100644
index 0000000..72a0096
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/SUMMARY.md
@@ -0,0 +1,49 @@
+# Summary
+
+* [1 源码构建](./build.md)
+* [2 框架设计](./design.md)
+* [3 扩展点加载](./SPI.md)
+* [4 实现细节](./implementation.md)
+* [5 SPI 扩展实现](./impls/introduction.md)
+ * [5.1 协议扩展](./impls/protocol.md)
+ * [5.2 调用拦截扩展](./impls/filter.md)
+ * [5.3 引用监听扩展](./impls/invoker-listener.md)
+ * [5.4 暴露监听扩展](./impls/exporter-listener.md)
+ * [5.5 集群扩展](./impls/cluster.md)
+ * [5.6 路由扩展](./impls/router.md)
+ * [5.7 负载均衡扩展](./impls/load-balance.md)
+ * [5.8 合并结果扩展](./impls/merger.md)
+ * [5.9 注册中心扩展](./impls/registry.md)
+ * [5.10 监控中心扩展](./impls/monitor.md)
+ * [5.11 扩展点加载扩展](./impls/extension-factory.md)
+ * [5.12 动态代理扩展](./impls/proxy-factory.md)
+ * [5.13 编译器扩展](./impls/compiler.md)
+ * [5.14 消息派发扩展](./impls/dispatcher.md)
+ * [5.15 线程池扩展](./impls/threadpool.md)
+ * [5.16 序列化扩展](./impls/serialize.md)
+ * [5.17 网络传输扩展](./impls/remoting.md)
+ * [5.18 信息交换扩展](./impls/exchanger.md)
+ * [5.19 组网扩展](./impls/networker.md)
+ * [5.20 Telnet 命令扩展](./impls/telnet-handler.md)
+ * [5.21 状态检查扩展](./impls/status-checker.md)
+ * [5.22 容器扩展](./impls/container.md)
+ * [5.23 页面扩展](./impls/page.md)
+ * [5.24 缓存扩展](./impls/cache.md)
+ * [5.25 验证扩展](./impls/validation.md)
+ * [5.26 日志适配扩展](./impls/logger-adapter.md)
+* [6 公共契约](./contract.md)
+* [7 编码约定](./coding.md)
+* [8 设计原则](./principals/introduction.md)
+ * [8.1 魔鬼在细节](./principals/code-detail.md)
+ * [8.2 一些设计上的基本常识](./principals/general-knowledge.md)
+ * [8.3 谈谈扩充式扩展与增量式扩展](./principals/expansibility.md)
+ * [8.4 配置设计](./principals/configuration.md)
+ * [8.5 设计实现的健壮性](./principals/robustness.md)
+ * [8.6 防痴呆设计](./principals/dummy.md)
+ * [8.7 扩展点重构](./principals/extension.md)
+* [9 版本管理](./release.md)
+* [10 贡献](./contribution.md)
+* [11 检查列表](./checklist.md)
+* [12 坏味道](./code-smell.md)
+* [13 技术兼容性测试](./TCK.md)
+
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/TCK.md b/doc-archive/v2.7.3/docs/zh-cn/dev/TCK.md
new file mode 100644
index 0000000..d5ab645
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/TCK.md
@@ -0,0 +1,19 @@
+# 技术兼容性测试
+
+Dubbo 的协议,通讯,序列化,注册中心,负载均策等扩展点,都有多种可选策略,以应对不同应用场景,而我们的测试用例很分散,当用户自己需要加一种新的实现时,总是不确定能否满足扩展点的完整契约。
+
+所以,我们需要对核心扩展点写 [TCK](http://en.wikipedia.org/wiki/Technology_Compatibility_Kit) (Technology Compatibility Kit),用户增加一种扩展实现,只需通过 TCK,即可确保与框架的其它部分兼容运行,可以有效提高整体健状性,也方便第三方扩展者接入,加速开源社区的成熟。
+
+开源社区的行知同学已着手研究这一块,他的初步想法是借鉴 JBoss 的 CDI-TCK,做一个 Dubbo 的 TCK 基础框架,在此之上实现 Dubbo 的扩展点 TCK 用例。
+
+参见:http://docs.jboss.org/cdi/tck/reference/1.0.1-Final/html/introduction.html
+
+如果大家有兴趣,也可以一起研究,和行知一块讨论。
+
+#### Protocol TCK
+
+> TODO
+
+#### Registry TCK
+
+> TODO
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/build.md b/doc-archive/v2.7.3/docs/zh-cn/dev/build.md
new file mode 100644
index 0000000..2ab327b
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/build.md
@@ -0,0 +1,79 @@
+# 源码构建
+
+## 代码签出
+
+通过以下的这个命令签出最新的项目源码 [^1]:
+
+```sh
+git clone https://github.com/apache/dubbo.git dubbo
+```
+
+## 分支
+
+我们使用 master 作为主干版本的开发,使用分支作为维护版本。可以通过 https://github.com/apache/dubbo/tags 来查看所有版本的标签。
+
+## 构建
+
+Dubbo 使用 [maven](http://maven.apache.org) 作为构建工具。
+
+要求
+
+* Java 1.5 以上的版本
+* Maven 2.2.1 或者以上的版本
+
+构建之前需要配置以下的 `MAVEN_OPTS`
+
+```sh
+export MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=512m
+```
+
+使用以下命令做一次构建
+
+```sh
+mvn clean install
+```
+
+可以通过以下的构建命令来跳过单元测试
+
+```sh
+mvn install -Dmaven.test.skip
+```
+
+## 构建源代码 jar 包
+
+通过以下命令以构建 Dubbo 的源代码 jar 包,方便用来调试 Dubbo 源代码
+
+```sh
+mvn clean source:jar install -Dmaven.test.skip
+```
+
+## IDE 支持
+
+使用以下命令来生成 IDE 的工程
+
+### Intellij Idea
+
+```sh
+mvn idea:idea
+```
+
+### eclipse
+
+```sh
+mvn eclipse:eclipse
+```
+
+在 eclipse 中导入
+
+首先,需要在 eclipse 中配置 maven 仓库。通过 Preferences -> Java -> Build Path -> Classpath 定义 `M2_REPO` 的 classpath 变量指向本地的 maven 仓库。 [^2]
+
+
+也可以通过以下的 maven 命令配置:
+
+```sh
+mvn eclipse:configure-workspace -Declipse.workspace=/path/to/the/workspace/
+```
+
+[^1]: 也可以直接在 https://github.com/apache/dubbo 上浏览源代码
+[^2]: UNIX 下的路径是 ${HOME}/.m2/repository, Windows 下的路径是 C:\Documents and Settings\<user>\.m2\repository
+
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/checklist.md b/doc-archive/v2.7.3/docs/zh-cn/dev/checklist.md
new file mode 100644
index 0000000..c165811
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/checklist.md
@@ -0,0 +1,27 @@
+# 检查列表
+
+## 发布前 checklist
+
+* jira ticket 过一遍
+* svn change list
+* ticket 关联 code
+* test code
+* find bugs
+
+## 修复时 checklist
+
+* 修复代码前先建 ticket
+* 修复代码前先写测试用例
+* 需要伙伴检查
+* test code(正常流程/异常流程)
+* 讲一遍逻辑
+* 契约文档化
+* 以上内容都写到ticket的评论上
+* 代码注释写清楚,用中文无妨
+* 每个版本要有 owner,确保 scope 和 check
+
+## Partner Check
+
+* Partner 以用户的方式运行一下功能
+* Partner 发现问题、添加测试(集成测试)直到不再复现;Owner 完成实现。(保证两方在Partner Check上的时间投入)
+* Owner 向 Partner 讲述一遍实现。
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/code-smell.md b/doc-archive/v2.7.3/docs/zh-cn/dev/code-smell.md
new file mode 100644
index 0000000..6330cbb
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/code-smell.md
@@ -0,0 +1,205 @@
+# 坏味道
+
+这里记录的是 Dubbo 设计或实现不优雅的地方。
+
+## URL 转换
+
+### 1. 点对点暴露和引用服务
+
+直接暴露服务:
+
+```
+EXPORT(dubbo://provider-address/com.xxx.XxxService?version=1.0.0")
+```
+
+点对点直连服务:
+
+```
+REFER(dubbo://provider-address/com.xxx.XxxService?version=1.0.0)
+```
+
+### 2. 通过注册中心暴露服务
+
+向注册中心暴露服务:
+
+```
+EXPORT(registry://registry-address/org.apache.dubbo.registry.RegistrySerevice?registry=dubbo&export=ENCODE(dubbo://provider-address/com.xxx.XxxService?version=1.0.0))
+```
+
+获取注册中心:
+
+```
+url.setProtocol(url.getParameter("registry", "dubbo"))
+GETREGISTRY(dubbo://registry-address/org.apache.dubbo.registry.RegistrySerevice)
+```
+
+注册服务地址:
+
+```
+url.getParameterAndDecoded("export"))
+REGISTER(dubbo://provider-address/com.xxx.XxxService?version=1.0.0)
+```
+
+### 3. 通过注册中心引用服务
+
+从注册中心订阅服务:
+
+```
+REFER(registry://registry-address/org.apache.dubbo.registry.RegistrySerevice?registry=dubbo&refer=ENCODE(version=1.0.0))
+```
+
+获取注册中心:
+
+```
+url.setProtocol(url.getParameter("registry", "dubbo"))
+GETREGISTRY(dubbo://registry-address/org.apache.dubbo.registry.RegistrySerevice)
+```
+
+订阅服务地址:
+
+```
+url.addParameters(url.getParameterAndDecoded("refer"))
+SUBSCRIBE(dubbo://registry-address/com.xxx.XxxService?version=1.0.0)
+```
+
+通知服务地址:
+
+```
+url.addParameters(url.getParameterAndDecoded("refer"))
+NOTIFY(dubbo://provider-address/com.xxx.XxxService?version=1.0.0)
+```
+
+### 4. 注册中心推送路由规则
+
+注册中心路由规则推送:
+
+```
+NOTIFY(route://registry-address/com.xxx.XxxService?router=script&type=js&rule=ENCODE(function{...}))
+```
+
+获取路由器:
+
+```
+url.setProtocol(url.getParameter("router", "script"))
+GETROUTE(script://registry-address/com.xxx.XxxService?type=js&rule=ENCODE(function{...}))
+```
+
+### 5. 从文件加载路由规则
+
+从文件加载路由规则:
+
+```
+GETROUTE(file://path/file.js?router=script)
+```
+
+获取路由器:
+
+```
+url.setProtocol(url.getParameter("router", "script")).addParameter("type", SUFFIX(file)).addParameter("rule", READ(file))
+GETROUTE(script://path/file.js?type=js&rule=ENCODE(function{...}))
+```
+
+## 调用参数
+
+* path 服务路径
+* group 服务分组
+* version 服务版本
+* dubbo 使用的 dubbo 版本
+* token 验证令牌
+* timeout 调用超时
+
+## 扩展点的加载
+
+### 1. 自适应扩展点
+
+ExtensionLoader 加载扩展点时,会检查扩展点的属性(通过set方法判断),如该属性是扩展点类型,则会注入扩展点对象。因为注入时不能确定使用哪个扩展点(在使用时确定),所以注入的是一个自适应扩展(一个代理)。自适应扩展点调用时,选取一个真正的扩展点,并代理到其上完成调用。Dubbo 是根据调用方法参数(上面有调用哪个扩展点的信息)来选取一个真正的扩展点。
+
+在 Dubbo 给定所有的扩展点上调用都有 URL 参数(整个扩展点网的上下文信息)。自适应扩展即是从 URL 确定要调用哪个扩展点实现。URL 哪个 Key 的 Value 用来确定使用哪个扩展点,这个信息通过的 `@Adaptive` 注解在方法上说明。
+
+```java
+@Extension
+public interface Car {
+ @Adaptive({"http://10.20.160.198/wiki/display/dubbo/car.type", "http://10.20.160.198/wiki/display/dubbo/transport.type"})
+ public run(URL url, Type1 arg1, Type2 arg2);
+}
+```
+
+由于自适应扩展点的上面的约定,ExtensionLoader 会为扩展点自动生成自适应扩展点类(通过字节码),并将其实例注入。
+
+ExtensionLoader 生成的自适应扩展点类如下:
+
+```java
+package <扩展点接口所在包>;
+
+public class <扩展点接口名>$Adpative implements <扩展点接口> {
+ public <有@Adaptive注解的接口方法>(<方法参数>) {
+ if(是否有URL类型方法参数?) 使用该URL参数
+ else if(是否有方法类型上有URL属性) 使用该URL属性
+ # <else 在加载扩展点生成自适应扩展点类时抛异常,即加载扩展点失败!>
+
+ if(获取的URL == null) {
+ throw new IllegalArgumentException("url == null");
+ }
+
+ 根据@Adaptive注解上声明的Key的顺序,从URL获致Value,作为实际扩展点名。
+ 如URL没有Value,则使用缺省扩展点实现。如没有扩展点, throw new IllegalStateException("Fail to get extension");
+
+ 在扩展点实现调用该方法,并返回结果。
+ }
+
+ public <有@Adaptive注解的接口方法>(<方法参数>) {
+ throw new UnsupportedOperationException("is not adaptive method!");
+ }
+}
+```
+
+`@Adaptive` 注解使用如下:
+
+如果 URL 这些 Key 都没有 Value,使用缺省的扩展(在接口的 Default 中设定的值)。比如,String[] {"key1", "key2"},表示先在 URL 上找 key1 的 Value 作为要 Adapt 成的 Extension 名;key1 没有 Value,则使用 key2 的 Value 作为要 Adapt 成的 Extension 名。 key2 没有 Value,使用缺省的扩展。如果没有设定缺省扩展,则方法调用会抛出 IllegalStateException。如果不设置则缺省使用 Extension 接口类名的点分隔小写字串。即对于 Extension 接口 `org.apache.dubbo.xxx.YyyInvokerWrapper` 的缺省值为 `new String[] {"yyy.invoker.wrapper"}`
+
+## Callback 功能
+
+### 1. 参数回调
+
+主要原理: 在一个 consumer->provider 的长连接上,自动在 Consumer 端暴露一个服务(实现方法参数上声明的接口A),provider 端便可反向调用到 consumer 端的接口实例。
+
+实现细节:
+
+* 为了在传输时能够对回调接口实例进行转换,自动暴露与自动引用目前在 DubboCodec 中实现。此处需要考虑将此逻辑与 codec 逻辑分离。
+* 在根据 invocation 信息获取 exporter 时,需要判断是否是回调,如果是回调,会从 attachments 中取得回调服务实例的 id,在获取 exporter,此处用于 consumer 端可以对同一个 callback 接口做不同的实现。
+
+### 2. 事件通知
+
+主要原理:Consumer 在 invoke 方法时,判断如果有配置 onreturn/onerror... 则将 onreturn 对应的参数值(实例方法)加入到异步调用的回调列表中。
+
+实现细节:参数的传递采用 URL,但 URL 中没有支持 string-object,所以将实例方法存储在 staticMap 中,此处实现需要进行改造。
+
+## Lazy连接
+
+DubboProtocol 特有功能,默认关闭。
+
+当客户端与服务端创建代理时,暂不建立 tcp 长连接,当有数据请求时在做连接初始化。
+
+此项功能自动关闭连接重试功能,开启发送重试功能(即发送数据时如果连接已断开,尝试重新建立连接)
+
+## 共享连接
+
+DubboProtocol 特有功能,默认开启。
+
+JVM A 暴露了多个服务,JVM B 引用了 A 中的多个服务,共享连接是说 A 与 B 多个服务调用是通过同一个 TCP 长连接进行数据传输,已达到减少服务端连接数的目的.
+
+实现细节:对于同一个地址由于使用了共享连接,那 invoker 的 destroy 就需要特别注意,一方面要满足对同一个地址 refer 的 invoker 全部 destroy 后,连接需要关闭,另一方面还需要注意如何避免部分 invoker destroy 时不能关闭连接。在实现中采用了引用计数的方案,但为了防范,在连接关闭时,重新建立了一个 Lazy connection (称为幽灵连接), 用于当出现异常场景时,避免影响业务逻辑的正常调用.
+
+## sticky 策略
+
+有多个服务提供者的情况下,配置了 sticky 后,在提供者可用的情况下,调用会继续发送到上一次的服务提供者。sticky 策略默认开启了连接的 lazy 选项, 用于避免开启无用的连接.
+
+## 服务提供者选择逻辑
+
+0. 存在多个服务提供者的情况下,首先根据 Loadbalance 进行选择,如果选择的 provider 处于可用状态,则进行后续调用
+0. 如果第一步选择的服务提供者不可用,则从剩余服务提供者列表中继续选择,如果可用,进行后续调用
+0. 如果所有的服务提供者都不可用,重新遍历整个列表(优先从没有选过的列表中选择),判断是否有可用的服务提供者(选择过程中,不可用的服务提供者可能会恢复到可用状态),如果有,则进行后续调用
+0. 如果第三步没有选择出可用的服务提供者,会选第一步选出的 invoker 中的下一个(如果不是最后一个),避免碰撞。
+
+
+
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/coding.md b/doc-archive/v2.7.3/docs/zh-cn/dev/coding.md
new file mode 100644
index 0000000..95d7ba8
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/coding.md
@@ -0,0 +1,53 @@
+# 编码约定
+
+## 代码风格
+
+Dubbo 的源代码和 JavaDoc 遵循以下的规范:
+
+* [Code Conventions for the Java Programming Language](http://www.oracle.com/technetwork/java/codeconvtoc-136057.html)
+* [How to Write Doc Comments for the Javadoc Tool](http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html)
+
+## 异常和日志
+
+* 尽可能携带完整的上下文信息,比如出错原因,出错的机器地址,调用对方的地址,连的注册中心地址,使用 Dubbo 的版本等。
+* 尽量将直接原因写在最前面,所有上下文信息,在原因后用键值对显示。
+* 抛出异常的地方不用打印日志,由最终处理异常者决定打印日志的级别,吃掉异常必需打印日志。
+* 打印 `ERROR` 日志表示需要报警,打印 `WARN` 日志表示可以自动恢复,打印 `INFO` 表示正常信息或完全不影响运行。
+* 建议应用方在监控中心配置 `ERROR` 日志实时报警,`WARN` 日志每周汇总发送通知。
+* `RpcException` 是 Dubbo 对外的唯一异常类型,所有内部异常,如果要抛出给用户,必须转为 `RpcException`。
+* `RpcException` 不能有子类型,所有类型信息用 ErrorCode 标识,以便保持兼容。
+
+## 配置和 URL
+
+* 配置对象属性首字母小写,多个单词用驼峰命名 [^1]。
+* 配置属性全部用小写,多个单词用"-"号分隔 [^2]。
+* URL参数全部用小写,多个单词用"."号分隔 [^3]。
+* 尽可能用 URL 传参,不要自定义 Map 或其它上下文格式,配置信息也转成 URL 格式使用。
+* 尽量减少 URL 嵌套,保持 URL 的简洁性。
+
+## 单元和集成测试
+
+* 单元测试统一用 JUnit 和 EasyMock,集成测试用 TestNG,数据库测试用 DBUnit。
+* 保持单元测试用例的运行速度,不要将性能和大的集成用例放在单元测试中。
+* 保持单元测试的每个用例都用 `try...finally` 或 `tearDown` 释放资源。
+* 减少 while 循环等待结果的测试用例,对定时器和网络的测试,用以将定时器中的逻辑抽为方法测试。
+* 对于容错行为的测试,比如 failsafe 的测试,统一用 `LogUtil` 断言日志输出。
+
+## 扩展点基类与 AOP
+
+* AOP 类都命名为 `XxxWrapper`,基类都命名为 `AbstractXxx`。
+* 扩展点之间的组合将关系由 AOP 完成,`ExtensionLoader` 只负载加载扩展点,包括 AOP 扩展。
+* 尽量采用 IoC 注入扩展点之间的依赖,不要直接依赖 `ExtensionLoader` 的工厂方法。
+* 尽量采用 AOP 实现扩展点的通用行为,而不要用基类,比如负载均衡之前的 `isAvailable` 检查,它是独立于负载均衡之外的,不需要检查的是URL参数关闭。
+* 对多种相似类型的抽象,用基类实现,比如 RMI, Hessian 等第三方协议都已生成了接口代理,只需将将接口代理转成 `Invoker` 即可完成桥接,它们可以用公共基类实现此逻辑。
+* 基类也是 SPI 的一部分,每个扩展点都应该有方便使用的基类支持。
+
+## 模块与分包
+
+* 基于复用度分包,总是一起使用的放在同一包下,将接口和基类分成独立模块,大的实现也使用独立模块。
+* 所有接口都放在模块的根包下,基类放在 support 子包下,不同实现用放在以扩展点名字命名的子包下。
+* 尽量保持子包依赖父包,而不要反向。
+
+[^1]: Java 约定
+[^2]: Spring 约定
+[^3]: Dubbo 约定
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/configcenter/design.md b/doc-archive/v2.7.3/docs/zh-cn/dev/configcenter/design.md
new file mode 100644
index 0000000..ae521a8
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/configcenter/design.md
@@ -0,0 +1,82 @@
+# Dubbo配置中心
+
+## 设计目的
+配置中心的核心功能是作为Key-Value存储,Dubbo框架告知配置中心其关心的key,配置中心返回该key对应的value值。
+
+按照应用场景划分,配置中心在Dubbo框架中主要承担以下职责:
+
+- 作为外部化配置中心,即存储dubbo.properties配置文件,此时,key值通常为文件名如dubbo.properties,value则为配置文件内容。
+- 存储单个配置项,如各种开关项、常量值等。
+- 存储服务治理规则,此时key通常按照"服务名+规则类型"的格式来组织,而value则为具体的治理规则。
+
+为了进一步实现对key-value的分组管理,Dubbo的配置中心还加入了namespace、group的概念,这些概念在很多专业的第三方配置中心中都有体现,通常情况下,namespace用来隔离不同的租户,group用来对统一租户的key集合做分组。
+
+当前,Dubbo配置中心实现了对Zookeeper、Nacos、Etcd、Consul、Apollo的对接,接下来我们具体看一下Dubbo抽象的配置中心是怎么映射到具体的第三方实现中的。
+
+## 实现原理
+
+### Zookeeper
+
+zookeeper提供了一个树状的存储模型,其实现原理如下:
+
+
+
+namespace, group, key等分别对应不同层级的ZNode节点,而value则作为根ZNode节点的值存储。
+
+1. 外部化配置中心 dubbo.properties
+
+ 
+
+ 上图展示了两个不同作用域的dubbo.properties文件在zookeeper中的存储结构:
+ - 命名空间namespace都为:dubbo
+ - 分组group:全局级别为dubbo,所有应用共享;应用级别为应用名demo-provider,只对改应用生效
+ - key:dubbo.properties
+
+2. 单个配置项
+
+ 
+
+ 设置优雅停机事件为15000:
+ - 命名空间namespace:dubbo
+ - 分组group:dubbo
+ - key:dubbo.service.shutdown.wait=15000
+
+3. 服务治理规则
+
+ 
+
+ 上图展示了一条应用级别的条件路由规则:
+
+ - 命名空间namespace:dubbo
+ - 分组group:dubbo
+ - key:governance-conditionrouter-consumer.condition-router,其中governance-conditionrouter-consumer为应用名,condition-router代表条件路由
+
+
+ > 注意:
+ >
+ > Dubbo同时支持应用、服务两种粒度的服务治理规则,对于这两种粒度,其key取值规则如下:
+ > * 应用粒度 {应用名 + 规则后缀}。如: `demo-application.configurators`、`demo-application.tag-router`等
+ > * 服务粒度 {服务接口名:[服务版本]:[服务分组] + 规则后缀},其中服务版本、服务分组是可选的,如果它们有配置则在key中体现,没被配置则用":"占位。如
+ > `org.apache.dubbo.demo.DemoService::.configurators`、`org.apache.dubbo.demo.DemoService:1.0.0:group1.configurators`
+
+### Etcd & Consul
+
+Etcd和Consul本质上也是一种类似zookeeper的树状存储结构,实现请参考zookeeper。
+
+### Nacos
+
+Nacos作为一个专业的第三方配置中心,拥有专门为配置中心设计的存储结构,包括内置的namespace、group、dataid等概念。并且这几个概念基本上与Dubbo框架抽象的配置中心是一一对应的。
+
+与Zookeeper实现的对应关系如下:
+
+
+
+参考上文关于zookeeper实现中描述的示例,这里的dataid可能为:
+* 外部化配置中心:dubbo.properties
+* 单个配置项:dubbo.service.shutdown.wait
+* 服务治理规则:org.apache.dubbo.demo.DemoService:1.0.0:group1.configurators
+
+### Apollo
+
+Apollo与Nacos类似,请参考动态配置中心使用文档中关于Apollo部分的描述。
+
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/contract.md b/doc-archive/v2.7.3/docs/zh-cn/dev/contract.md
new file mode 100644
index 0000000..5ee45a5
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/contract.md
@@ -0,0 +1,14 @@
+# 公共契约
+
+这里记录的是 Dubbo 公共契约,希望所有扩展点遵守。
+
+## URL
+
+* 所有扩展点参数都包含 URL 参数,URL 作为上下文信息贯穿整个扩展点设计体系。
+* URL 采用标准格式:`protocol://username:password@host:port/path?key=value&key=value`
+
+## 日志
+
+* 如果不可恢复或需要报警,打印 ERROR 日志。
+* 如果可恢复异常,或瞬时的状态不一致,打印 WARN 日志。
+* 正常运行时的中间状态提示,打印 INFO 日志。
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/contribution.md b/doc-archive/v2.7.3/docs/zh-cn/dev/contribution.md
new file mode 100644
index 0000000..e8141bf
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/contribution.md
@@ -0,0 +1,45 @@
+# 贡献
+
+## 流程
+
+* 如果是扩展功能,直接新增工程,黑盒依赖 Dubbo 进行扩展。
+* 如果是改 BUG,或修改框架本身,可以从 Dubbo 的 GitHub 上 Fork 工程。
+* 修改后通过 Push Request 反馈修改。
+
+## 任务
+
+功能 | 分类 | 优先级 | 状态 | 认领者 | 计划完成时间 | 进度
+------------- | ------------- | ------------- | ------------- | ------------- | ------------- | -------------
+《用户指南》翻译 | 文档 | 高 | 未认领 | 待定 | 待定 | 0%
+《开发指南》翻译 |文档 | 高 | 未认领 | 待定 | 待定 |0%
+扩展点兼容性测试 |测试 | 高 | 已认领 | 罗立树 | 待定 | 0%
+性能基准测试 | 测试 | 高 | 未认领 | 待定 | 待定 | 0%
+功能单元测试 | 测试 | 高 | 未认领 | 待定 | 待定 | 0%
+JTA/XA分布式事务 | 拦截扩展 | 高 | 未认领 | 待定 | 待定 | 0%
+Thrift | 协议扩展 | 高 | 开发完成 | 闾刚 | 2012-04-27 | 90%
+ICE | 协议扩展 | 高 | 未认领 | 待定 | 待定 | 0%
+ACE | 协议扩展 | 低 | 未认领 | 待定 | 待定 | 0%
+JSON-RPC | 协议扩展 | 低 | 未认领 | 待定 | 待定 | 0%
+XML-RPC | 协议扩展 | 低 | 未认领 | 待定 | 待定 | 0%
+JSR181&CXF(WebService) | 协议扩展 | 高 | 开发完成 | 白文志 | 2012-04-27 | 90%
+JSR311&JSR339(RestfulWebService) | 协议扩展 | 高 | 未认领 | 待定 | 待定 | 0%
+JMS&ActiveMQ | 协议扩展 | 高 | 未认领 | 待定 | 待定 | 0%
+Protobuf | 序列化扩展 | 高 | 调研 | 朱启恒 | 2012-02-30 | 20%
+Avro | 序列化扩展 | 低 | 未认领 | 待定 | 待定 | 0%
+XSocket | 传输扩展 | 低 | 未认领 | 待定 | 待定 | 0%
+CGLib | 动态代理扩展 | 低 | 未认领 | 待定 | 待定 | 0%
+JNDI | 注册中心扩展 | 高 | 未认领 | 待定 | 待定 | 0%
+LDAP | 注册中心扩展 | 低 | 未认领 | 待定 | 待定 | 0%
+JSR140&SLP | 注册中心扩展 | 高 | 未认领 | 待定 | 待定 | 0%
+UDDI | 注册中心扩展 | 高 | 未认领 | 待定 | 待定 | 0%
+JMX | 监控中心扩展 | 高 | 未认领 | 待定 | 待定 | 0%
+SNMP | 监控中心扩展 | 高 | 未认领 | 待定 | 待定 | 0%
+Cacti | 监控中心扩展 | 高 | 未认领 | 待定 | 待定 | 0%
+Nagios | 监控中心扩展 | 高 | 未认领 | 待定 | 待定 | 0%
+Logstash | 监控中心扩展 | 高 | 未认领 | 待定 | 待定 | 0%
+JRobin | 监控中心扩展 | 高 | 未认领 | 待定 | 待定 | 0%
+Maven | 服务安装包仓库 | 低 | 未认领 | 待定 | 待定 | 0%
+Subversion | 服务安装包仓库 | 低 | 未认领 | 待定 | 待定 | 0%
+JCR/JSR283 | 服务安装包仓库 | 低 | 未认领 | 待定 | 待定 | 0%
+SimpleDeployer | 本地部署代理 | 低 | 未认领 | 待定 | 待定 | 0%
+SimpleScheduler | 资源调度器 | 低 | 未认领 | 待定 | 待定 | 0%
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/design.md b/doc-archive/v2.7.3/docs/zh-cn/dev/design.md
new file mode 100644
index 0000000..7645e9a
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/design.md
@@ -0,0 +1,99 @@
+# 框架设计
+
+## 整体设计
+
+
+
+图例说明:
+
+* 图中左边淡蓝背景的为服务消费方使用的接口,右边淡绿色背景的为服务提供方使用的接口,位于中轴线上的为双方都用到的接口。
+* 图中从下至上分为十层,各层均为单向依赖,右边的黑色箭头代表层之间的依赖关系,每一层都可以剥离上层被复用,其中,Service 和 Config 层为 API,其它各层均为 SPI。
+* 图中绿色小块的为扩展接口,蓝色小块为实现类,图中只显示用于关联各层的实现类。
+* 图中蓝色虚线为初始化过程,即启动时组装链,红色实线为方法调用过程,即运行时调时链,紫色三角箭头为继承,可以把子类看作父类的同一个节点,线上的文字为调用的方法。
+
+## 各层说明
+
+* **config 配置层**:对外配置接口,以 `ServiceConfig`, `ReferenceConfig` 为中心,可以直接初始化配置类,也可以通过 spring 解析配置生成配置类
+* **proxy 服务代理层**:服务接口透明代理,生成服务的客户端 Stub 和服务器端 Skeleton, 以 `ServiceProxy` 为中心,扩展接口为 `ProxyFactory`
+* **registry 注册中心层**:封装服务地址的注册与发现,以服务 URL 为中心,扩展接口为 `RegistryFactory`, `Registry`, `RegistryService`
+* **cluster 路由层**:封装多个提供者的路由及负载均衡,并桥接注册中心,以 `Invoker` 为中心,扩展接口为 `Cluster`, `Directory`, `Router`, `LoadBalance`
+* **monitor 监控层**:RPC 调用次数和调用时间监控,以 `Statistics` 为中心,扩展接口为 `MonitorFactory`, `Monitor`, `MonitorService`
+* **protocol 远程调用层**:封装 RPC 调用,以 `Invocation`, `Result` 为中心,扩展接口为 `Protocol`, `Invoker`, `Exporter`
+* **exchange 信息交换层**:封装请求响应模式,同步转异步,以 `Request`, `Response` 为中心,扩展接口为 `Exchanger`, `ExchangeChannel`, `ExchangeClient`, `ExchangeServer`
+* **transport 网络传输层**:抽象 mina 和 netty 为统一接口,以 `Message` 为中心,扩展接口为 `Channel`, `Transporter`, `Client`, `Server`, `Codec`
+* **serialize 数据序列化层**:可复用的一些工具,扩展接口为 `Serialization`, `ObjectInput`, `ObjectOutput`, `ThreadPool`
+
+## 关系说明
+
+* 在 RPC 中,Protocol 是核心层,也就是只要有 Protocol + Invoker + Exporter 就可以完成非透明的 RPC 调用,然后在 Invoker 的主过程上 Filter 拦截点。
+* 图中的 Consumer 和 Provider 是抽象概念,只是想让看图者更直观的了解哪些类分属于客户端与服务器端,不用 Client 和 Server 的原因是 Dubbo 在很多场景下都使用 Provider, Consumer, Registry, Monitor 划分逻辑拓普节点,保持统一概念。
+* 而 Cluster 是外围概念,所以 Cluster 的目的是将多个 Invoker 伪装成一个 Invoker,这样其它人只要关注 Protocol 层 Invoker 即可,加上 Cluster 或者去掉 Cluster 对其它层都不会造成影响,因为只有一个提供者时,是不需要 Cluster 的。
+* Proxy 层封装了所有接口的透明化代理,而在其它层都以 Invoker 为中心,只有到了暴露给用户使用时,才用 Proxy 将 Invoker 转成接口,或将接口实现转成 Invoker,也就是去掉 Proxy 层 RPC 是可以 Run 的,只是不那么透明,不那么看起来像调本地服务一样调远程服务。
+* 而 Remoting 实现是 Dubbo 协议的实现,如果你选择 RMI 协议,整个 Remoting 都不会用上,Remoting 内部再划为 Transport 传输层和 Exchange 信息交换层,Transport 层只负责单向消息传输,是对 Mina, Netty, Grizzly 的抽象,它也可以扩展 UDP 传输,而 Exchange 层是在传输层之上封装了 Request-Response 语义。
+* Registry 和 Monitor 实际上不算一层,而是一个独立的节点,只是为了全局概览,用层的方式画在一起。
+
+## 模块分包
+
+
+
+模块说明:
+
+* **dubbo-common 公共逻辑模块**:包括 Util 类和通用模型。
+* **dubbo-remoting 远程通讯模块**:相当于 Dubbo 协议的实现,如果 RPC 用 RMI协议则不需要使用此包。
+* **dubbo-rpc 远程调用模块**:抽象各种协议,以及动态代理,只包含一对一的调用,不关心集群的管理。
+* **dubbo-cluster 集群模块**:将多个服务提供方伪装为一个提供方,包括:负载均衡, 容错,路由等,集群的地址列表可以是静态配置的,也可以是由注册中心下发。
+* **dubbo-registry 注册中心模块**:基于注册中心下发地址的集群方式,以及对各种注册中心的抽象。
+* **dubbo-monitor 监控模块**:统计服务调用次数,调用时间的,调用链跟踪的服务。
+* **dubbo-config 配置模块**:是 Dubbo 对外的 API,用户通过 Config 使用Dubbo,隐藏 Dubbo 所有细节。
+* **dubbo-container 容器模块**:是一个 Standlone 的容器,以简单的 Main 加载 Spring 启动,因为服务通常不需要 Tomcat/JBoss 等 Web 容器的特性,没必要用 Web 容器去加载服务。
+
+整体上按照分层结构进行分包,与分层的不同点在于:
+
+* container 为服务容器,用于部署运行服务,没有在层中画出。
+* protocol 层和 proxy 层都放在 rpc 模块中,这两层是 rpc 的核心,在不需要集群也就是只有一个提供者时,可以只使用这两层完成 rpc 调用。
+* transport 层和 exchange 层都放在 remoting 模块中,为 rpc 调用的通讯基础。
+* serialize 层放在 common 模块中,以便更大程度复用。
+
+## 依赖关系
+
+
+
+图例说明:
+
+* 图中小方块 Protocol, Cluster, Proxy, Service, Container, Registry, Monitor 代表层或模块,蓝色的表示与业务有交互,绿色的表示只对 Dubbo 内部交互。
+* 图中背景方块 Consumer, Provider, Registry, Monitor 代表部署逻辑拓扑节点。
+* 图中蓝色虚线为初始化时调用,红色虚线为运行时异步调用,红色实线为运行时同步调用。
+* 图中只包含 RPC 的层,不包含 Remoting 的层,Remoting 整体都隐含在 Protocol 中。
+
+## 调用链
+
+展开总设计图的红色调用链,如下:
+
+
+
+## 暴露服务时序
+
+展开总设计图左边服务提供方暴露服务的蓝色初始化链,时序图如下:
+
+
+
+## 引用服务时序
+
+展开总设计图右边服务消费方引用服务的蓝色初始化链,时序图如下:
+
+
+
+## 领域模型
+
+在 Dubbo 的核心领域模型中:
+
+* Protocol 是服务域,它是 Invoker 暴露和引用的主功能入口,它负责 Invoker 的生命周期管理。
+* Invoker 是实体域,它是 Dubbo 的核心模型,其它模型都向它靠扰,或转换成它,它代表一个可执行体,可向它发起 invoke 调用,它有可能是一个本地的实现,也可能是一个远程的实现,也可能一个集群实现。
+* Invocation 是会话域,它持有调用过程中的变量,比如方法名,参数等。
+
+## 基本设计原则
+
+* 采用 Microkernel + Plugin 模式,Microkernel 只负责组装 Plugin,Dubbo 自身的功能也是通过扩展点实现的,也就是 Dubbo 的所有功能点都可被用户自定义扩展所替换。
+* 采用 URL 作为配置信息的统一格式,所有扩展点都通过传递 URL 携带配置信息。
+
+更多设计原则参见:[框架设计原则](./principals/introduction.md)
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/implementation.md b/doc-archive/v2.7.3/docs/zh-cn/dev/implementation.md
new file mode 100644
index 0000000..31bc95d
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/implementation.md
@@ -0,0 +1,226 @@
+# 实现细节
+
+## 初始化过程细节
+
+### 解析服务
+
+基于 dubbo.jar 内的 `META-INF/spring.handlers` 配置,Spring 在遇到 dubbo 名称空间时,会回调 `DubboNamespaceHandler`。
+
+所有 dubbo 的标签,都统一用 `DubboBeanDefinitionParser` 进行解析,基于一对一属性映射,将 XML 标签解析为 Bean 对象。
+
+在 `ServiceConfig.export()` 或 `ReferenceConfig.get()` 初始化时,将 Bean 对象转换 URL 格式,所有 Bean 属性转成 URL 的参数。
+
+然后将 URL 传给 [协议扩展点](./impls/protocol.md),基于扩展点的 [扩展点自适应机制](./SPI.md),根据 URL 的协议头,进行不同协议的服务暴露或引用。
+
+### 暴露服务
+
+#### 1. 只暴露服务端口:
+
+在没有注册中心,直接暴露提供者的情况下 [^1],`ServiceConfig` 解析出的 URL 的格式为:
+`dubbo://service-host/com.foo.FooService?version=1.0.0`。
+
+基于扩展点自适应机制,通过 URL 的 `dubbo://` 协议头识别,直接调用 `DubboProtocol`的 `export()` 方法,打开服务端口。
+
+#### 2. 向注册中心暴露服务:
+
+在有注册中心,需要注册提供者地址的情况下 [^2],`ServiceConfig` 解析出的 URL 的格式为: `registry://registry-host/org.apache.dubbo.registry.RegistryService?export=URL.encode("dubbo://service-host/com.foo.FooService?version=1.0.0")`,
+
+基于扩展点自适应机制,通过 URL 的 `registry://` 协议头识别,就会调用 `RegistryProtocol` 的 `export()` 方法,将 `export` 参数中的提供者 URL,先注册到注册中心。
+
+再重新传给 `Protocol` 扩展点进行暴露: `dubbo://service-host/com.foo.FooService?version=1.0.0`,然后基于扩展点自适应机制,通过提供者 URL 的 `dubbo://` 协议头识别,就会调用 `DubboProtocol` 的 `export()` 方法,打开服务端口。
+
+### 引用服务
+
+#### 1. 直连引用服务:
+
+在没有注册中心,直连提供者的情况下 [^3],`ReferenceConfig` 解析出的 URL 的格式为:`dubbo://service-host/com.foo.FooService?version=1.0.0`。
+
+基于扩展点自适应机制,通过 URL 的 `dubbo://` 协议头识别,直接调用 `DubboProtocol` 的 `refer()` 方法,返回提供者引用。
+
+#### 2. 从注册中心发现引用服务:
+
+在有注册中心,通过注册中心发现提供者地址的情况下 [^4],`ReferenceConfig` 解析出的 URL 的格式为:
+`registry://registry-host/org.apache.dubbo.registry.RegistryService?refer=URL.encode("consumer://consumer-host/com.foo.FooService?version=1.0.0")`。
+
+基于扩展点自适应机制,通过 URL 的 `registry://` 协议头识别,就会调用 `RegistryProtocol` 的 `refer()` 方法,基于 `refer` 参数中的条件,查询提供者 URL,如:
+`dubbo://service-host/com.foo.FooService?version=1.0.0`。
+
+基于扩展点自适应机制,通过提供者 URL 的 `dubbo://` 协议头识别,就会调用 `DubboProtocol` 的 `refer()` 方法,得到提供者引用。
+
+然后 `RegistryProtocol` 将多个提供者引用,通过 `Cluster` 扩展点,伪装成单个提供者引用返回。
+
+### 拦截服务
+
+基于扩展点自适应机制,所有的 `Protocol` 扩展点都会自动套上 `Wrapper` 类。
+
+基于 `ProtocolFilterWrapper` 类,将所有 `Filter` 组装成链,在链的最后一节调用真实的引用。
+
+基于 `ProtocolListenerWrapper` 类,将所有 `InvokerListener` 和 `ExporterListener` 组装集合,在暴露和引用前后,进行回调。
+
+包括监控在内,所有附加功能,全部通过 `Filter` 拦截实现。
+
+## 远程调用细节
+
+### 服务提供者暴露一个服务的详细过程
+
+
+
+上图是服务提供者暴露服务的主过程:
+
+首先 `ServiceConfig` 类拿到对外提供服务的实际类 ref(如:HelloWorldImpl),然后通过 `ProxyFactory` 类的 `getInvoker` 方法使用 ref 生成一个 `AbstractProxyInvoker` 实例,到这一步就完成具体服务到 `Invoker` 的转化。接下来就是 `Invoker` 转换到 `Exporter` 的过程。
+
+Dubbo 处理服务暴露的关键就在 `Invoker` 转换到 `Exporter` 的过程,上图中的红色部分。下面我们以 Dubbo 和 RMI 这两种典型协议的实现来进行说明:
+
+#### Dubbo 的实现
+
+Dubbo 协议的 `Invoker` 转为 `Exporter` 发生在 `DubboProtocol` 类的 `export` 方法,它主要是打开 socket 侦听服务,并接收客户端发来的各种请求,通讯细节由 Dubbo 自己实现。
+
+#### RMI 的实现
+
+RMI 协议的 `Invoker` 转为 `Exporter` 发生在 `RmiProtocol`类的 `export` 方法,它通过 Spring 或 Dubbo 或 JDK 来实现 RMI 服务,通讯细节这一块由 JDK 底层来实现,这就省了不少工作量。
+
+### 服务消费者消费一个服务的详细过程
+
+
+
+上图是服务消费的主过程:
+
+首先 `ReferenceConfig` 类的 `init` 方法调用 `Protocol` 的 `refer` 方法生成 `Invoker` 实例(如上图中的红色部分),这是服务消费的关键。接下来把 `Invoker` 转换为客户端需要的接口(如:HelloWorld)。
+
+关于每种协议如 RMI/Dubbo/Web service 等它们在调用 `refer` 方法生成 `Invoker` 实例的细节和上一章节所描述的类似。
+
+### 满眼都是 Invoker
+
+由于 `Invoker` 是 Dubbo 领域模型中非常重要的一个概念,很多设计思路都是向它靠拢。这就使得 `Invoker` 渗透在整个实现代码里,对于刚开始接触 Dubbo 的人,确实容易给搞混了。
+下面我们用一个精简的图来说明最重要的两种 `Invoker`:服务提供 `Invoker` 和服务消费 `Invoker`:
+
+
+
+为了更好的解释上面这张图,我们结合服务消费和提供者的代码示例来进行说明:
+
+服务消费者代码:
+
+```java
+public class DemoClientAction {
+
+ private DemoService demoService;
+
+ public void setDemoService(DemoService demoService) {
+ this.demoService = demoService;
+ }
+
+ public void start() {
+ String hello = demoService.sayHello("world" + i);
+ }
+}
+```
+
+上面代码中的 `DemoService` 就是上图中服务消费端的 proxy,用户代码通过这个 proxy 调用其对应的 `Invoker` [^5],而该 `Invoker` 实现了真正的远程服务调用。
+
+服务提供者代码:
+
+```java
+public class DemoServiceImpl implements DemoService {
+
+ public String sayHello(String name) throws RemoteException {
+ return "Hello " + name;
+ }
+}
+```
+
+上面这个类会被封装成为一个 `AbstractProxyInvoker` 实例,并新生成一个 `Exporter` 实例。这样当网络通讯层收到一个请求后,会找到对应的 `Exporter` 实例,并调用它所对应的 `AbstractProxyInvoker` 实例,从而真正调用了服务提供者的代码。Dubbo 里还有一些其他的 `Invoker` 类,但上面两种是最重要的。
+
+## 远程通讯细节
+
+### 协议头约定
+
+
+
+
+- Magic - Magic High & Magic Low (16 bits)
+
+ Identifies dubbo protocol with value: 0xdabb
+
+- Req/Res (1 bit)
+
+ Identifies this is a request or response. Request - 1; Response - 0.
+
+- 2 Way (1 bit)
+
+ Only useful when Req/Res is 1 (Request), expect for a return value from server or not. Set to 1 if need a return value from server.
+
+- Event (1 bit)
+
+ Identifies an event message or not, for example, heartbeat event. Set to 1 if this is an event.
+
+- Serialization ID (5 bit)
+
+ Identifies serialization type: the value for fastjson is 6.
+
+- Status (8 bits)
+
+ Only useful when Req/Res is 0 (Response), identifies the status of response
+
+ - 20 - OK
+ - 30 - CLIENT_TIMEOUT
+ - 31 - SERVER_TIMEOUT
+ - 40 - BAD_REQUEST
+ - 50 - BAD_RESPONSE
+ - 60 - SERVICE_NOT_FOUND
+ - 70 - SERVICE_ERROR
+ - 80 - SERVER_ERROR
+ - 90 - CLIENT_ERROR
+ - 100 - SERVER_THREADPOOL_EXHAUSTED_ERROR
+
+- Request ID (64 bits)
+
+ Identifies an unique request. Numeric (long).
+
+- Data Length (32)
+
+ Length of the content (the variable part) after serialization, counted by bytes. Numeric (integer).
+
+- Variable Part
+
+ Each part is a byte[] after serialization with specific serialization type, identifies by Serialization ID.
+
+Every part is a byte[] after serialization with specific serialization type, identifies by Serialization ID
+
+1. If the content is a Request (Req/Res = 1), each part consists of the content, in turn is:
+ - Dubbo version
+ - Service name
+ - Service version
+ - Method name
+ - Method parameter types
+ - Method arguments
+ - Attachments
+
+1. If the content is a Response (Req/Res = 0), each part consists of the content, in turn is:
+ - Return value type, identifies what kind of value returns from server side: RESPONSE_NULL_VALUE - 2, RESPONSE_VALUE - 1, RESPONSE_WITH_EXCEPTION - 0.
+ - Return value, the real value returns from server.
+
+
+**注意:**对于(Variable Part)变长部分,当前版本的dubbo框架使用json序列化时,在每部分内容间额外增加了换行符作为分隔,请选手在Variable Part的每个part后额外增加换行符, 如:
+```
+Dubbo version bytes (换行符)
+Service name bytes (换行符)
+...
+```
+
+### 线程派发模型
+
+
+
+* Dispather: `all`, `direct`, `message`, `execution`, `connection`
+* ThreadPool: `fixed`, `cached`
+
+
+[^1]: 即:`<dubbo:service regisrty="N/A" />` 或者 `<dubbo:registry address="N/A" />`
+[^2]: 即: `<dubbo:registry address="zookeeper://10.20.153.10:2181" />`
+[^3]: 即:`<dubbo:reference url="dubbo://service-host/com.foo.FooService?version=1.0.0" />`
+[^4]: 即:`<dubbo:registry address="zookeeper://10.20.153.10:2181" />`
+[^5]: `DubboInvoker`、 `HessianRpcInvoker`、 `InjvmInvoker`、 `RmiInvoker`、 `WebServiceInvoker` 中的任何一个
+
+
+
+
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/cache.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/cache.md
new file mode 100644
index 0000000..2b558d4
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/cache.md
@@ -0,0 +1,83 @@
+# 缓存扩展
+
+## 扩展说明
+
+用请求参数作为 key,缓存返回结果。
+
+## 扩展接口
+
+`org.apache.dubbo.cache.CacheFactory`
+
+## 扩展配置
+
+```xml
+<dubbo:service cache="lru" />
+<!-- 方法级缓存 -->
+<dubbo:service><dubbo:method cache="lru" /></dubbo:service>
+<!-- 缺省值设置,当<dubbo:service>没有配置cache属性时,使用此配置 -->
+<dubbo:provider cache="xxx,yyy" />
+```
+
+## 已知扩展
+
+* `org.apache.dubbo.cache.support.lru.LruCacheFactory`
+* `org.apache.dubbo.cache.support.threadlocal.ThreadLocalCacheFactory`
+* `org.apache.dubbo.cache.support.jcache.JCacheFactory`
+
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxCacheFactory.java (实现StatusChecker接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.cache.CacheFactory (纯文本文件,内容为:xxx=com.xxx.XxxCacheFactory)
+```
+
+XxxCacheFactory.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.cache.CacheFactory;
+
+public class XxxCacheFactory implements CacheFactory {
+ public Cache getCache(URL url, String name) {
+ return new XxxCache(url, name);
+ }
+}
+```
+
+XxxCacheFactory.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.cache.Cache;
+
+public class XxxCache implements Cache {
+ public Cache(URL url, String name) {
+ // ...
+ }
+ public void put(Object key, Object value) {
+ // ...
+ }
+ public Object get(Object key) {
+ // ...
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.cache.CacheFactory:
+
+```properties
+xxx=com.xxx.XxxCacheFactory
+```
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/cluster.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/cluster.md
new file mode 100644
index 0000000..6227683
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/cluster.md
@@ -0,0 +1,74 @@
+# 集群扩展
+
+## 扩展说明
+
+当有多个服务提供方时,将多个服务提供方组织成一个集群,并伪装成一个提供方。
+
+## 扩展接口
+
+`org.apache.dubbo.rpc.cluster.Cluster`
+
+## 扩展配置
+
+```xml
+<dubbo:protocol cluster="xxx" />
+<!-- 缺省值配置,如果<dubbo:protocol>没有配置cluster时,使用此配置 -->
+<dubbo:provider cluster="xxx" />
+```
+
+## 已知扩展
+
+* `org.apache.dubbo.rpc.cluster.support.FailoverCluster`
+* `org.apache.dubbo.rpc.cluster.support.FailfastCluster`
+* `org.apache.dubbo.rpc.cluster.support.FailsafeCluster`
+* `org.apache.dubbo.rpc.cluster.support.FailbackCluster`
+* `org.apache.dubbo.rpc.cluster.support.ForkingCluster`
+* `org.apache.dubbo.rpc.cluster.support.AvailableCluster`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxCluster.java (实现Cluster接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.rpc.cluster.Cluster (纯文本文件,内容为:xxx=com.xxx.XxxCluster)
+```
+
+XxxCluster.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.rpc.cluster.Cluster;
+import org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker;
+import org.apache.dubbo.rpc.cluster.Directory;
+import org.apache.dubbo.rpc.cluster.LoadBalance;
+import org.apache.dubbo.rpc.Invoker;
+import org.apache.dubbo.rpc.Invocation;
+import org.apache.dubbo.rpc.Result;
+import org.apache.dubbo.rpc.RpcException;
+
+public class XxxCluster implements Cluster {
+ public <T> Invoker<T> merge(Directory<T> directory) throws RpcException {
+ return new AbstractClusterInvoker<T>(directory) {
+ public Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
+ // ...
+ }
+ };
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.rpc.cluster.Cluster:
+
+```properties
+xxx=com.xxx.XxxCluster
+```
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/compiler.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/compiler.md
new file mode 100644
index 0000000..7207f70
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/compiler.md
@@ -0,0 +1,55 @@
+# 编译器扩展
+
+## 扩展说明
+
+Java 代码编译器,用于动态生成字节码,加速调用。
+
+## 扩展接口
+
+`org.apache.dubbo.common.compiler.Compiler`
+
+## 扩展配置
+
+自动加载
+
+## 已知扩展
+
+* `org.apache.dubbo.common.compiler.support.JdkCompiler`
+* `org.apache.dubbo.common.compiler.support.JavassistCompiler`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxCompiler.java (实现Compiler接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.common.compiler.Compiler (纯文本文件,内容为:xxx=com.xxx.XxxCompiler)
+```
+
+XxxCompiler.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.common.compiler.Compiler;
+
+public class XxxCompiler implements Compiler {
+ public Object getExtension(Class<?> type, String name) {
+ // ...
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.common.compiler.Compiler:
+
+```properties
+xxx=com.xxx.XxxCompiler
+```
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/container.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/container.md
new file mode 100644
index 0000000..6732041
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/container.md
@@ -0,0 +1,62 @@
+# 容器扩展
+
+## 扩展说明
+
+服务容器扩展,用于自定义加载内容。
+
+## 扩展接口
+
+`org.apache.dubbo.container.Container`
+
+## 扩展配置
+
+```sh
+java org.apache.dubbo.container.Main spring jetty log4j
+```
+
+## 已知扩展
+
+* `org.apache.dubbo.container.spring.SpringContainer`
+* `org.apache.dubbo.container.spring.JettyContainer`
+* `org.apache.dubbo.container.spring.Log4jContainer`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxContainer.java (实现Container接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.container.Container (纯文本文件,内容为:xxx=com.xxx.XxxContainer)
+```
+
+XxxContainer.java:
+
+```java
+package com.xxx;
+
+org.apache.dubbo.container.Container;
+
+
+public class XxxContainer implements Container {
+ public Status start() {
+ // ...
+ }
+ public Status stop() {
+ // ...
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.container.Container:
+
+```properties
+xxx=com.xxx.XxxContainer
+```
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/dispatcher.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/dispatcher.md
new file mode 100644
index 0000000..4c587bf
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/dispatcher.md
@@ -0,0 +1,62 @@
+# 消息派发扩展
+
+## 扩展说明
+
+通道信息派发器,用于指定线程池模型。
+
+## 扩展接口
+
+`org.apache.dubbo.remoting.Dispatcher`
+
+## 扩展配置
+
+```xml
+<dubbo:protocol dispatcher="xxx" />
+<!-- 缺省值设置,当<dubbo:protocol>没有配置dispatcher属性时,使用此配置 -->
+<dubbo:provider dispatcher="xxx" />
+```
+
+## 已知扩展
+
+* `org.apache.dubbo.remoting.transport.dispatcher.all.AllDispatcher`
+* `org.apache.dubbo.remoting.transport.dispatcher.direct.DirectDispatcher`
+* `org.apache.dubbo.remoting.transport.dispatcher.message.MessageOnlyDispatcher`
+* `org.apache.dubbo.remoting.transport.dispatcher.execution.ExecutionDispatcher`
+* `org.apache.dubbo.remoting.transport.dispatcher.connection.ConnectionOrderedDispatcher`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxDispatcher.java (实现Dispatcher接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.remoting.Dispatcher (纯文本文件,内容为:xxx=com.xxx.XxxDispatcher)
+```
+
+XxxDispatcher.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.remoting.Dispatcher;
+
+public class XxxDispatcher implements Dispatcher {
+ public Group lookup(URL url) {
+ // ...
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.remoting.Dispatcher:
+
+```properties
+xxx=com.xxx.XxxDispatcher
+```
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/exchanger.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/exchanger.md
new file mode 100644
index 0000000..7658c0a
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/exchanger.md
@@ -0,0 +1,90 @@
+# 信息交换扩展
+## 扩展说明
+
+基于传输层之上,实现 Request-Response 信息交换语义。
+
+## 扩展接口
+
+* `org.apache.dubbo.remoting.exchange.Exchanger`
+* `org.apache.dubbo.remoting.exchange.ExchangeServer`
+* `org.apache.dubbo.remoting.exchange.ExchangeClient`
+
+## 扩展配置
+
+```xml
+<dubbo:protocol exchanger="xxx" />
+<!-- 缺省值设置,当<dubbo:protocol>没有配置exchanger属性时,使用此配置 -->
+<dubbo:provider exchanger="xxx" />
+```
+
+## 已知扩展
+
+`org.apache.dubbo.remoting.exchange.exchanger.HeaderExchanger`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxExchanger.java (实现Exchanger接口)
+ |-XxxExchangeServer.java (实现ExchangeServer接口)
+ |-XxxExchangeClient.java (实现ExchangeClient接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.remoting.exchange.Exchanger (纯文本文件,内容为:xxx=com.xxx.XxxExchanger)
+```
+
+XxxExchanger.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.remoting.exchange.Exchanger;
+
+
+public class XxxExchanger implements Exchanger {
+ public ExchangeServer bind(URL url, ExchangeHandler handler) throws RemotingException {
+ return new XxxExchangeServer(url, handler);
+ }
+ public ExchangeClient connect(URL url, ExchangeHandler handler) throws RemotingException {
+ return new XxxExchangeClient(url, handler);
+ }
+}
+```
+
+XxxExchangeServer.java:
+
+```java
+
+package com.xxx;
+
+import org.apache.dubbo.remoting.exchange.ExchangeServer;
+
+public class XxxExchangeServer impelements ExchangeServer {
+ // ...
+}
+```
+
+XxxExchangeClient.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.remoting.exchange.ExchangeClient;
+
+public class XxxExchangeClient impelments ExchangeClient {
+ // ...
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.remoting.exchange.Exchanger:
+
+```properties
+xxx=com.xxx.XxxExchanger
+```
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/exporter-listener.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/exporter-listener.md
new file mode 100644
index 0000000..c069b9f
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/exporter-listener.md
@@ -0,0 +1,66 @@
+# 暴露监听扩展
+
+## 扩展说明
+
+当有服务暴露时,触发该事件。
+
+## 扩展接口
+
+`org.apache.dubbo.rpc.ExporterListener`
+
+## 扩展配置
+
+```xml
+<!-- 暴露服务监听 -->
+<dubbo:service listener="xxx,yyy" />
+<!-- 暴露服务缺省监听器 -->
+<dubbo:provider listener="xxx,yyy" />
+```
+
+## 已知扩展
+
+`org.apache.dubbo.registry.directory.RegistryExporterListener`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxExporterListener.java (实现ExporterListener接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.rpc.ExporterListener (纯文本文件,内容为:xxx=com.xxx.XxxExporterListener)
+```
+
+XxxExporterListener.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.rpc.ExporterListener;
+import org.apache.dubbo.rpc.Exporter;
+import org.apache.dubbo.rpc.RpcException;
+
+
+public class XxxExporterListener implements ExporterListener {
+ public void exported(Exporter<?> exporter) throws RpcException {
+ // ...
+ }
+ public void unexported(Exporter<?> exporter) throws RpcException {
+ // ...
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.rpc.ExporterListener:
+
+```properties
+xxx=com.xxx.XxxExporterListener
+```
+
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/extension-factory.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/extension-factory.md
new file mode 100644
index 0000000..a6fb073
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/extension-factory.md
@@ -0,0 +1,57 @@
+# 扩展点加载扩展
+
+## 扩展说明
+
+扩展点本身的加载容器,可从不同容器加载扩展点。
+
+## 扩展接口
+
+`org.apache.dubbo.common.extension.ExtensionFactory`
+
+## 扩展配置
+
+```xml
+<dubbo:application compiler="jdk" />
+```
+
+## 已知扩展
+
+* `org.apache.dubbo.common.extension.factory.SpiExtensionFactory`
+* `org.apache.dubbo.config.spring.extension.SpringExtensionFactory`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxExtensionFactory.java (实现ExtensionFactory接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.common.extension.ExtensionFactory (纯文本文件,内容为:xxx=com.xxx.XxxExtensionFactory)
+```
+
+XxxExtensionFactory.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.common.extension.ExtensionFactory;
+
+public class XxxExtensionFactory implements ExtensionFactory {
+ public Object getExtension(Class<?> type, String name) {
+ // ...
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.common.extension.ExtensionFactory:
+
+```properties
+xxx=com.xxx.XxxExtensionFactory
+```
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/filter.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/filter.md
new file mode 100644
index 0000000..920db1f
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/filter.md
@@ -0,0 +1,89 @@
+# 调用拦截扩展
+
+## 扩展说明
+
+服务提供方和服务消费方调用过程拦截,Dubbo 本身的大多功能均基于此扩展点实现,每次远程方法执行,该拦截都会被执行,请注意对性能的影响。
+
+约定:
+
+* 用户自定义 filter 默认在内置 filter 之后。
+* 特殊值 `default`,表示缺省扩展点插入的位置。比如:`filter="xxx,default,yyy"`,表示 `xxx` 在缺省 filter 之前,`yyy` 在缺省 filter 之后。
+* 特殊符号 `-`,表示剔除。比如:`filter="-foo1"`,剔除添加缺省扩展点 `foo1`。比如:`filter="-default"`,剔除添加所有缺省扩展点。
+* provider 和 service 同时配置的 filter 时,累加所有 filter,而不是覆盖。比如:`<dubbo:provider filter="xxx,yyy"/>` 和 `<dubbo:service filter="aaa,bbb" />`,则 `xxx`,`yyy`,`aaa`,`bbb` 均会生效。如果要覆盖,需配置:`<dubbo:service filter="-xxx,-yyy,aaa,bbb" />`
+
+## 扩展接口
+
+`org.apache.dubbo.rpc.Filter`
+
+## 扩展配置
+
+```xml
+<!-- 消费方调用过程拦截 -->
+<dubbo:reference filter="xxx,yyy" />
+<!-- 消费方调用过程缺省拦截器,将拦截所有reference -->
+<dubbo:consumer filter="xxx,yyy"/>
+<!-- 提供方调用过程拦截 -->
+<dubbo:service filter="xxx,yyy" />
+<!-- 提供方调用过程缺省拦截器,将拦截所有service -->
+<dubbo:provider filter="xxx,yyy"/>
+```
+
+## 已知扩展
+
+* `org.apache.dubbo.rpc.filter.EchoFilter`
+* `org.apache.dubbo.rpc.filter.GenericFilter`
+* `org.apache.dubbo.rpc.filter.GenericImplFilter`
+* `org.apache.dubbo.rpc.filter.TokenFilter`
+* `org.apache.dubbo.rpc.filter.AccessLogFilter`
+* `org.apache.dubbo.rpc.filter.CountFilter`
+* `org.apache.dubbo.rpc.filter.ActiveLimitFilter`
+* `org.apache.dubbo.rpc.filter.ClassLoaderFilter`
+* `org.apache.dubbo.rpc.filter.ContextFilter`
+* `org.apache.dubbo.rpc.filter.ConsumerContextFilter`
+* `org.apache.dubbo.rpc.filter.ExceptionFilter`
+* `org.apache.dubbo.rpc.filter.ExecuteLimitFilter`
+* `org.apache.dubbo.rpc.filter.DeprecatedFilter`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxFilter.java (实现Filter接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.rpc.Filter (纯文本文件,内容为:xxx=com.xxx.XxxFilter)
+```
+
+XxxFilter.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.rpc.Filter;
+import org.apache.dubbo.rpc.Invoker;
+import org.apache.dubbo.rpc.Invocation;
+import org.apache.dubbo.rpc.Result;
+import org.apache.dubbo.rpc.RpcException;
+
+public class XxxFilter implements Filter {
+ public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
+ // before filter ...
+ Result result = invoker.invoke(invocation);
+ // after filter ...
+ return result;
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.rpc.Filter:
+
+```properties
+xxx=com.xxx.XxxFilter
+```
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/introduction.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/introduction.md
new file mode 100644
index 0000000..5bfe331
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/introduction.md
@@ -0,0 +1,3 @@
+# SPI 扩展实现
+
+SPI 扩展接口仅用于系统集成,或 Contributor 扩展功能插件。
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/invoker-listener.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/invoker-listener.md
new file mode 100644
index 0000000..780c82c
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/invoker-listener.md
@@ -0,0 +1,64 @@
+# 引用监听扩展
+
+## 扩展说明
+
+当有服务引用时,触发该事件。
+
+## 扩展接口
+
+`org.apache.dubbo.rpc.InvokerListener`
+
+## 扩展配置
+
+```xml
+<!-- 引用服务监听 -->
+<dubbo:reference listener="xxx,yyy" />
+<!-- 引用服务缺省监听器 -->
+<dubbo:consumer listener="xxx,yyy" />
+```
+
+## 已知扩展
+
+`org.apache.dubbo.rpc.listener.DeprecatedInvokerListener`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxInvokerListener.java (实现InvokerListener接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.rpc.InvokerListener (纯文本文件,内容为:xxx=com.xxx.XxxInvokerListener)
+```
+
+XxxInvokerListener.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.rpc.InvokerListener;
+import org.apache.dubbo.rpc.Invoker;
+import org.apache.dubbo.rpc.RpcException;
+
+public class XxxInvokerListener implements InvokerListener {
+ public void referred(Invoker<?> invoker) throws RpcException {
+ // ...
+ }
+ public void destroyed(Invoker<?> invoker) throws RpcException {
+ // ...
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.rpc.InvokerListener:
+
+```properties
+xxx=com.xxx.XxxInvokerListener
+```
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/load-balance.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/load-balance.md
new file mode 100644
index 0000000..4217e55
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/load-balance.md
@@ -0,0 +1,63 @@
+# 负载均衡扩展
+
+## 扩展说明
+
+从多个服务提者方中选择一个进行调用
+
+## 扩展接口
+
+`org.apache.dubbo.rpc.cluster.LoadBalance`
+
+## 扩展配置
+
+```xml
+<dubbo:protocol loadbalance="xxx" />
+<!-- 缺省值设置,当<dubbo:protocol>没有配置loadbalance时,使用此配置 -->
+<dubbo:provider loadbalance="xxx" />
+```
+
+## 已知扩展
+
+* `org.apache.dubbo.rpc.cluster.loadbalance.RandomLoadBalance`
+* `org.apache.dubbo.rpc.cluster.loadbalance.RoundRobinLoadBalance`
+* `org.apache.dubbo.rpc.cluster.loadbalance.LeastActiveLoadBalance`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxLoadBalance.java (实现LoadBalance接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.rpc.cluster.LoadBalance (纯文本文件,内容为:xxx=com.xxx.XxxLoadBalance)
+```
+
+XxxLoadBalance.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.rpc.cluster.LoadBalance;
+import org.apache.dubbo.rpc.Invoker;
+import org.apache.dubbo.rpc.Invocation;
+import org.apache.dubbo.rpc.RpcException;
+
+public class XxxLoadBalance implements LoadBalance {
+ public <T> Invoker<T> select(List<Invoker<T>> invokers, Invocation invocation) throws RpcException {
+ // ...
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.rpc.cluster.LoadBalance:
+
+```properties
+xxx=com.xxx.XxxLoadBalance
+```
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/logger-adapter.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/logger-adapter.md
new file mode 100644
index 0000000..93065bb
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/logger-adapter.md
@@ -0,0 +1,84 @@
+# 日志适配扩展
+
+## 扩展说明
+
+日志输出适配扩展点。
+
+## 扩展接口
+
+`org.apache.dubbo.common.logger.LoggerAdapter`
+
+## 扩展配置
+
+```xml
+<dubbo:application logger="xxx" />
+```
+
+或者:
+
+```sh
+-Ddubbo:application.logger=xxx
+```
+
+## 已知扩展
+
+* `org.apache.dubbo.common.logger.slf4j.Slf4jLoggerAdapter`
+* `org.apache.dubbo.common.logger.jcl.JclLoggerAdapter`
+* `org.apache.dubbo.common.logger.log4j.Log4jLoggerAdapter`
+* `org.apache.dubbo.common.logger.log4j2.Log4j2LoggerAdapter`
+* `org.apache.dubbo.common.logger.jdk.JdkLoggerAdapter`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxLoggerAdapter.java (实现LoggerAdapter接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.common.logger.LoggerAdapter (纯文本文件,内容为:xxx=com.xxx.XxxLoggerAdapter)
+```
+
+XxxLoggerAdapter.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.common.logger.LoggerAdapter;
+
+public class XxxLoggerAdapter implements LoggerAdapter {
+ public Logger getLogger(URL url) {
+ // ...
+ }
+}
+```
+
+XxxLogger.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.common.logger.Logger;
+
+public class XxxLogger implements Logger {
+ public XxxLogger(URL url) {
+ // ...
+ }
+ public void info(String msg) {
+ // ...
+ }
+ // ...
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.common.logger.LoggerAdapter:
+
+```properties
+xxx=com.xxx.XxxLoggerAdapter
+```
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/merger.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/merger.md
new file mode 100644
index 0000000..c81ade1
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/merger.md
@@ -0,0 +1,60 @@
+# 合并结果扩展
+
+## 扩展说明
+
+合并返回结果,用于分组聚合。
+
+## 扩展接口
+
+`org.apache.dubbo.rpc.cluster.Merger`
+
+## 扩展配置
+
+```xml
+<dubbo:method merger="xxx" />
+```
+
+## 已知扩展
+
+* `org.apache.dubbo.rpc.cluster.merger.ArrayMerger`
+* `org.apache.dubbo.rpc.cluster.merger.ListMerger`
+* `org.apache.dubbo.rpc.cluster.merger.SetMerger`
+* `org.apache.dubbo.rpc.cluster.merger.MapMerger`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxMerger.java (实现Merger接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.rpc.cluster.Merger (纯文本文件,内容为:xxx=com.xxx.XxxMerger)
+```
+
+XxxMerger.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.rpc.cluster.Merger;
+
+public class XxxMerger<T> implements Merger<T> {
+ public T merge(T... results) {
+ // ...
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.rpc.cluster.Merger:
+
+```properties
+xxx=com.xxx.XxxMerger
+```
+
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/monitor.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/monitor.md
new file mode 100644
index 0000000..1ccb1d8
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/monitor.md
@@ -0,0 +1,75 @@
+# 监控中心扩展
+
+## 扩展说明
+
+负责服务调用次和调用时间的监控。
+
+## 扩展接口
+
+* `org.apache.dubbo.monitor.MonitorFactory`
+* `org.apache.dubbo.monitor.Monitor`
+
+## 扩展配置
+
+```xml
+<!-- 定义监控中心 -->
+<dubbo:monitor address="xxx://ip:port" />
+```
+
+## 已知扩展
+
+org.apache.dubbo.monitor.support.dubbo.DubboMonitorFactory
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxMonitorFactoryjava (实现MonitorFactory接口)
+ |-XxxMonitor.java (实现Monitor接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.monitor.MonitorFactory (纯文本文件,内容为:xxx=com.xxx.XxxMonitorFactory)
+```
+
+XxxMonitorFactory.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.monitor.MonitorFactory;
+import org.apache.dubbo.monitor.Monitor;
+import org.apache.dubbo.common.URL;
+
+public class XxxMonitorFactory implements MonitorFactory {
+ public Monitor getMonitor(URL url) {
+ return new XxxMonitor(url);
+ }
+}
+```
+
+XxxMonitor.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.monitor.Monitor;
+
+public class XxxMonitor implements Monitor {
+ public void count(URL statistics) {
+ // ...
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.monitor.MonitorFactory:
+
+```properties
+xxx=com.xxx.XxxMonitorFactory
+```
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/networker.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/networker.md
new file mode 100644
index 0000000..63bb639
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/networker.md
@@ -0,0 +1,59 @@
+# 组网扩展
+
+## 扩展说明
+
+对等网络节点组网器。
+
+## 扩展接口
+
+`org.apache.dubbo.remoting.p2p.Networker`
+
+## 扩展配置
+
+```xml
+<dubbo:protocol networker="xxx" />
+<!-- 缺省值设置,当<dubbo:protocol>没有配置networker属性时,使用此配置 -->
+<dubbo:provider networker="xxx" />
+```
+
+## 已知扩展
+
+* `org.apache.dubbo.remoting.p2p.support.MulticastNetworker`
+* `org.apache.dubbo.remoting.p2p.support.FileNetworker`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxNetworker.java (实现Networker接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.remoting.p2p.Networker (纯文本文件,内容为:xxx=com.xxx.XxxNetworker)
+```
+
+XxxNetworker.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.remoting.p2p.Networker;
+
+public class XxxNetworker implements Networker {
+ public Group lookup(URL url) {
+ // ...
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.remoting.p2p.Networker:
+
+```properties
+xxx=com.xxx.XxxNetworker
+```
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/page.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/page.md
new file mode 100644
index 0000000..f12c38d
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/page.md
@@ -0,0 +1,61 @@
+# 页面扩展
+
+## 扩展说明
+
+对等网络节点组网器。
+
+## 扩展接口
+
+`org.apache.dubbo.container.page.PageHandler`
+
+## 扩展配置
+
+```xml
+<dubbo:protocol page="xxx,yyy" />
+<!-- 缺省值设置,当<dubbo:protocol>没有配置page属性时,使用此配置 -->
+<dubbo:provider page="xxx,yyy" />
+```
+
+## 已知扩展
+
+* `org.apache.dubbo.container.page.pages.HomePageHandler`
+* `org.apache.dubbo.container.page.pages.StatusPageHandler`
+* `org.apache.dubbo.container.page.pages.LogPageHandler`
+* `org.apache.dubbo.container.page.pages.SystemPageHandler`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxPageHandler.java (实现PageHandler接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.container.page.PageHandler (纯文本文件,内容为:xxx=com.xxx.XxxPageHandler)
+```
+
+XxxPageHandler.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.container.page.PageHandler;
+
+public class XxxPageHandler implements PageHandler {
+ public Group lookup(URL url) {
+ // ...
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.container.page.PageHandler:
+
+```properties
+xxx=com.xxx.XxxPageHandler
+```
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/protocol.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/protocol.md
new file mode 100644
index 0000000..b7c8ebd
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/protocol.md
@@ -0,0 +1,151 @@
+# 协议扩展
+
+## 扩展说明
+
+RPC 协议扩展,封装远程调用细节。
+
+契约:
+
+* 当用户调用 `refer()` 所返回的 `Invoker` 对象的 `invoke()` 方法时,协议需相应执行同 URL 远端 `export()` 传入的 `Invoker` 对象的 `invoke()` 方法。
+* 其中,`refer()` 返回的 `Invoker` 由协议实现,协议通常需要在此 `Invoker` 中发送远程请求,`export()` 传入的 `Invoker` 由框架实现并传入,协议不需要关心。
+
+注意:
+
+* 协议不关心业务接口的透明代理,以 `Invoker` 为中心,由外层将 `Invoker` 转换为业务接口。
+* 协议不一定要是 TCP 网络通讯,比如通过共享文件,IPC 进程间通讯等。
+
+## 扩展接口
+
+* `org.apache.dubbo.rpc.Protocol`
+* `org.apache.dubbo.rpc.Exporter`
+* `org.apache.dubbo.rpc.Invoker`
+
+```java
+public interface Protocol {
+ /**
+ * 暴露远程服务:<br>
+ * 1. 协议在接收请求时,应记录请求来源方地址信息:RpcContext.getContext().setRemoteAddress();<br>
+ * 2. export()必须是幂等的,也就是暴露同一个URL的Invoker两次,和暴露一次没有区别。<br>
+ * 3. export()传入的Invoker由框架实现并传入,协议不需要关心。<br>
+ *
+ * @param <T> 服务的类型
+ * @param invoker 服务的执行体
+ * @return exporter 暴露服务的引用,用于取消暴露
+ * @throws RpcException 当暴露服务出错时抛出,比如端口已占用
+ */
+ <T> Exporter<T> export(Invoker<T> invoker) throws RpcException;
+
+ /**
+ * 引用远程服务:<br>
+ * 1. 当用户调用refer()所返回的Invoker对象的invoke()方法时,协议需相应执行同URL远端export()传入的Invoker对象的invoke()方法。<br>
+ * 2. refer()返回的Invoker由协议实现,协议通常需要在此Invoker中发送远程请求。<br>
+ * 3. 当url中有设置check=false时,连接失败不能抛出异常,需内部自动恢复。<br>
+ *
+ * @param <T> 服务的类型
+ * @param type 服务的类型
+ * @param url 远程服务的URL地址
+ * @return invoker 服务的本地代理
+ * @throws RpcException 当连接服务提供方失败时抛出
+ */
+ <T> Invoker<T> refer(Class<T> type, URL url) throws RpcException;
+
+}
+```
+
+## 扩展配置
+
+```xml
+<!-- 声明协议,如果没有配置id,将以name为id -->
+<dubbo:protocol id="xxx1" name="xxx" />
+<!-- 引用协议,如果没有配置protocol属性,将在ApplicationContext中自动扫描protocol配置 -->
+<dubbo:service protocol="xxx1" />
+<!-- 引用协议缺省值,当<dubbo:service>没有配置prototol属性时,使用此配置 -->
+<dubbo:provider protocol="xxx1" />
+```
+
+## 已知扩展
+
+* `org.apache.dubbo.rpc.injvm.InjvmProtocol`
+* `org.apache.dubbo.rpc.dubbo.DubboProtocol`
+* `org.apache.dubbo.rpc.rmi.RmiProtocol`
+* `org.apache.dubbo.rpc.http.HttpProtocol`
+* `org.apache.dubbo.rpc.http.hessian.HessianProtocol`
+
+## 扩展示例
+
+Maven项目结构:
+
+```
+
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxProtocol.java (实现Protocol接口)
+ |-XxxExporter.java (实现Exporter接口)
+ |-XxxInvoker.java (实现Invoker接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.rpc.Protocol (纯文本文件,内容为:xxx=com.xxx.XxxProtocol)
+```
+
+XxxProtocol.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.rpc.Protocol;
+
+public class XxxProtocol implements Protocol {
+ public <T> Exporter<T> export(Invoker<T> invoker) throws RpcException {
+ return new XxxExporter(invoker);
+ }
+ public <T> Invoker<T> refer(Class<T> type, URL url) throws RpcException {
+ return new XxxInvoker(type, url);
+ }
+}
+```
+
+XxxExporter.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.rpc.support.AbstractExporter;
+
+public class XxxExporter<T> extends AbstractExporter<T> {
+ public XxxExporter(Invoker<T> invoker) throws RemotingException{
+ super(invoker);
+ // ...
+ }
+ public void unexport() {
+ super.unexport();
+ // ...
+ }
+}
+```
+
+XxxInvoker.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.rpc.support.AbstractInvoker;
+
+public class XxxInvoker<T> extends AbstractInvoker<T> {
+ public XxxInvoker(Class<T> type, URL url) throws RemotingException{
+ super(type, url);
+ }
+ protected abstract Object doInvoke(Invocation invocation) throws Throwable {
+ // ...
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.rpc.Protocol:
+
+```properties
+xxx=com.xxx.XxxProtocol
+```
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/proxy-factory.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/proxy-factory.md
new file mode 100644
index 0000000..79009d4
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/proxy-factory.md
@@ -0,0 +1,65 @@
+# 动态代理扩展
+
+## 扩展说明
+
+将 `Invoker` 接口转换成业务接口。
+
+## 扩展接口
+
+`org.apache.dubbo.rpc.ProxyFactory`
+
+## 扩展配置
+
+```xml
+<dubbo:protocol proxy="xxx" />
+<!-- 缺省值配置,当<dubbo:protocol>没有配置proxy属性时,使用此配置 -->
+<dubbo:provider proxy="xxx" />
+```
+
+## 已知扩展
+
+* `org.apache.dubbo.rpc.proxy.JdkProxyFactory`
+* `org.apache.dubbo.rpc.proxy.JavassistProxyFactory`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxProxyFactory.java (实现ProxyFactory接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.rpc.ProxyFactory (纯文本文件,内容为:xxx=com.xxx.XxxProxyFactory)
+```
+
+XxxProxyFactory.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.rpc.ProxyFactory;
+import org.apache.dubbo.rpc.Invoker;
+import org.apache.dubbo.rpc.RpcException;
+
+
+public class XxxProxyFactory implements ProxyFactory {
+ public <T> T getProxy(Invoker<T> invoker) throws RpcException {
+ // ...
+ }
+ public <T> Invoker<T> getInvoker(T proxy, Class<T> type, URL url) throws RpcException {
+ // ...
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.rpc.ProxyFactory:
+
+```properties
+xxx=com.xxx.XxxProxyFactory
+```
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/registry.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/registry.md
new file mode 100644
index 0000000..c22761e
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/registry.md
@@ -0,0 +1,205 @@
+# 注册中心扩展
+
+## 扩展说明
+
+负责服务的注册与发现。
+
+## 扩展接口
+
+* `org.apache.dubbo.registry.RegistryFactory`
+* `org.apache.dubbo.registry.Registry`
+
+## 扩展配置
+
+```xml
+<!-- 定义注册中心 -->
+<dubbo:registry id="xxx1" address="xxx://ip:port" />
+<!-- 引用注册中心,如果没有配置registry属性,将在ApplicationContext中自动扫描registry配置 -->
+<dubbo:service registry="xxx1" />
+<!-- 引用注册中心缺省值,当<dubbo:service>没有配置registry属性时,使用此配置 -->
+<dubbo:provider registry="xxx1" />
+```
+
+## 扩展契约
+
+RegistryFactory.java:
+
+```java
+public interface RegistryFactory {
+ /**
+ * 连接注册中心.
+ *
+ * 连接注册中心需处理契约:<br>
+ * 1. 当设置check=false时表示不检查连接,否则在连接不上时抛出异常。<br>
+ * 2. 支持URL上的username:password权限认证。<br>
+ * 3. 支持backup=10.20.153.10备选注册中心集群地址。<br>
+ * 4. 支持file=registry.cache本地磁盘文件缓存。<br>
+ * 5. 支持timeout=1000请求超时设置。<br>
+ * 6. 支持session=60000会话超时或过期设置。<br>
+ *
+ * @param url 注册中心地址,不允许为空
+ * @return 注册中心引用,总不返回空
+ */
+ Registry getRegistry(URL url);
+}
+```
+
+RegistryService.java:
+
+```java
+public interface RegistryService { // Registry extends RegistryService
+ /**
+ * 注册服务.
+ *
+ * 注册需处理契约:<br>
+ * 1. 当URL设置了check=false时,注册失败后不报错,在后台定时重试,否则抛出异常。<br>
+ * 2. 当URL设置了dynamic=false参数,则需持久存储,否则,当注册者出现断电等情况异常退出时,需自动删除。<br>
+ * 3. 当URL设置了category=overrides时,表示分类存储,缺省类别为providers,可按分类部分通知数据。<br>
+ * 4. 当注册中心重启,网络抖动,不能丢失数据,包括断线自动删除数据。<br>
+ * 5. 允许URI相同但参数不同的URL并存,不能覆盖。<br>
+ *
+ * @param url 注册信息,不允许为空,如:dubbo://10.20.153.10/com.alibaba.foo.BarService?version=1.0.0&application=kylin
+ */
+ void register(URL url);
+
+ /**
+ * 取消注册服务.
+ *
+ * 取消注册需处理契约:<br>
+ * 1. 如果是dynamic=false的持久存储数据,找不到注册数据,则抛IllegalStateException,否则忽略。<br>
+ * 2. 按全URL匹配取消注册。<br>
+ *
+ * @param url 注册信息,不允许为空,如:dubbo://10.20.153.10/com.alibaba.foo.BarService?version=1.0.0&application=kylin
+ */
+ void unregister(URL url);
+
+ /**
+ * 订阅服务.
+ *
+ * 订阅需处理契约:<br>
+ * 1. 当URL设置了check=false时,订阅失败后不报错,在后台定时重试。<br>
+ * 2. 当URL设置了category=overrides,只通知指定分类的数据,多个分类用逗号分隔,并允许星号通配,表示订阅所有分类数据。<br>
+ * 3. 允许以interface,group,version,classifier作为条件查询,如:interface=com.alibaba.foo.BarService&version=1.0.0<br>
+ * 4. 并且查询条件允许星号通配,订阅所有接口的所有分组的所有版本,或:interface=*&group=*&version=*&classifier=*<br>
+ * 5. 当注册中心重启,网络抖动,需自动恢复订阅请求。<br>
+ * 6. 允许URI相同但参数不同的URL并存,不能覆盖。<br>
+ * 7. 必须阻塞订阅过程,等第一次通知完后再返回。<br>
+ *
+ * @param url 订阅条件,不允许为空,如:consumer://10.20.153.10/com.alibaba.foo.BarService?version=1.0.0&application=kylin
+ * @param listener 变更事件监听器,不允许为空
+ */
+ void subscribe(URL url, NotifyListener listener);
+
+ /**
+ * 取消订阅服务.
+ *
+ * 取消订阅需处理契约:<br>
+ * 1. 如果没有订阅,直接忽略。<br>
+ * 2. 按全URL匹配取消订阅。<br>
+ *
+ * @param url 订阅条件,不允许为空,如:consumer://10.20.153.10/com.alibaba.foo.BarService?version=1.0.0&application=kylin
+ * @param listener 变更事件监听器,不允许为空
+ */
+ void unsubscribe(URL url, NotifyListener listener);
+
+ /**
+ * 查询注册列表,与订阅的推模式相对应,这里为拉模式,只返回一次结果。
+ *
+ * @see org.apache.dubbo.registry.NotifyListener#notify(List)
+ * @param url 查询条件,不允许为空,如:consumer://10.20.153.10/com.alibaba.foo.BarService?version=1.0.0&application=kylin
+ * @return 已注册信息列表,可能为空,含义同{@link org.apache.dubbo.registry.NotifyListener#notify(List<URL>)}的参数。
+ */
+ List<URL> lookup(URL url);
+
+}
+```
+
+NotifyListener.java:
+
+```java
+public interface NotifyListener {
+ /**
+ * 当收到服务变更通知时触发。
+ *
+ * 通知需处理契约:<br>
+ * 1. 总是以服务接口和数据类型为维度全量通知,即不会通知一个服务的同类型的部分数据,用户不需要对比上一次通知结果。<br>
+ * 2. 订阅时的第一次通知,必须是一个服务的所有类型数据的全量通知。<br>
+ * 3. 中途变更时,允许不同类型的数据分开通知,比如:providers, consumers, routes, overrides,允许只通知其中一种类型,但该类型的数据必须是全量的,不是增量的。<br>
+ * 4. 如果一种类型的数据为空,需通知一个empty协议并带category参数的标识性URL数据。<br>
+ * 5. 通知者(即注册中心实现)需保证通知的顺序,比如:单线程推送,队列串行化,带版本对比。<br>
+ *
+ * @param urls 已注册信息列表,总不为空,含义同{@link org.apache.dubbo.registry.RegistryService#lookup(URL)}的返回值。
+ */
+ void notify(List<URL> urls);
+
+}
+```
+
+## 已知扩展
+
+`org.apache.dubbo.registry.support.dubbo.DubboRegistryFactory`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxRegistryFactoryjava (实现RegistryFactory接口)
+ |-XxxRegistry.java (实现Registry接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.registry.RegistryFactory (纯文本文件,内容为:xxx=com.xxx.XxxRegistryFactory)
+```
+
+XxxRegistryFactory.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.registry.RegistryFactory;
+import org.apache.dubbo.registry.Registry;
+import org.apache.dubbo.common.URL;
+
+public class XxxRegistryFactory implements RegistryFactory {
+ public Registry getRegistry(URL url) {
+ return new XxxRegistry(url);
+ }
+}
+```
+
+XxxRegistry.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.registry.Registry;
+import org.apache.dubbo.registry.NotifyListener;
+import org.apache.dubbo.common.URL;
+
+public class XxxRegistry implements Registry {
+ public void register(URL url) {
+ // ...
+ }
+ public void unregister(URL url) {
+ // ...
+ }
+ public void subscribe(URL url, NotifyListener listener) {
+ // ...
+ }
+ public void unsubscribe(URL url, NotifyListener listener) {
+ // ...
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.registry.RegistryFactory:
+
+```properties
+xxx=com.xxx.XxxRegistryFactory
+```
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/remoting.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/remoting.md
new file mode 100644
index 0000000..e6a06c0
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/remoting.md
@@ -0,0 +1,122 @@
+# 网络传输扩展
+
+## 扩展说明
+
+远程通讯的服务器及客户端传输实现。
+
+## 扩展接口
+
+* `org.apache.dubbo.remoting.Transporter`
+* `org.apache.dubbo.remoting.Server`
+* `org.apache.dubbo.remoting.Client`
+
+## 扩展配置
+
+```xml
+<!-- 服务器和客户端使用相同的传输实现 -->
+<dubbo:protocol transporter="xxx" />
+<!-- 服务器和客户端使用不同的传输实现 -->
+<dubbo:protocol server="xxx" client="xxx" />
+<!-- 缺省值设置,当<dubbo:protocol>没有配置transporter/server/client属性时,使用此配置 -->
+<dubbo:provider transporter="xxx" server="xxx" client="xxx" />
+```
+
+## 已知扩展
+
+* `org.apache.dubbo.remoting.transport.transporter.netty.NettyTransporter`
+* `org.apache.dubbo.remoting.transport.transporter.mina.MinaTransporter`
+* `org.apache.dubbo.remoting.transport.transporter.grizzly.GrizzlyTransporter`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxTransporter.java (实现Transporter接口)
+ |-XxxServer.java (实现Server接口)
+ |-XxxClient.java (实现Client接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.remoting.Transporter (纯文本文件,内容为:xxx=com.xxx.XxxTransporter)
+```
+
+XxxTransporter.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.remoting.Transporter;
+
+public class XxxTransporter implements Transporter {
+ public Server bind(URL url, ChannelHandler handler) throws RemotingException {
+ return new XxxServer(url, handler);
+ }
+ public Client connect(URL url, ChannelHandler handler) throws RemotingException {
+ return new XxxClient(url, handler);
+ }
+}
+```
+
+XxxServer.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.remoting.transport.transporter.AbstractServer;
+
+public class XxxServer extends AbstractServer {
+ public XxxServer(URL url, ChannelHandler handler) throws RemotingException{
+ super(url, handler);
+ }
+ protected void doOpen() throws Throwable {
+ // ...
+ }
+ protected void doClose() throws Throwable {
+ // ...
+ }
+ public Collection<Channel> getChannels() {
+ // ...
+ }
+ public Channel getChannel(InetSocketAddress remoteAddress) {
+ // ...
+ }
+}
+```
+
+XxxClient.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.remoting.transport.transporter.AbstractClient;
+
+public class XxxClient extends AbstractClient {
+ public XxxServer(URL url, ChannelHandler handler) throws RemotingException{
+ super(url, handler);
+ }
+ protected void doOpen() throws Throwable {
+ // ...
+ }
+ protected void doClose() throws Throwable {
+ // ...
+ }
+ protected void doConnect() throws Throwable {
+ // ...
+ }
+ public Channel getChannel() {
+ // ...
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.remoting.Transporter:
+
+```properties
+xxx=com.xxx.XxxTransporter
+```
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/router.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/router.md
new file mode 100644
index 0000000..ad7f549
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/router.md
@@ -0,0 +1,58 @@
+# 路由扩展
+
+## 扩展说明
+
+从多个服务提者方中选择一个进行调用。
+
+## 扩展接口
+
+* `org.apache.dubbo.rpc.cluster.RouterFactory`
+* `org.apache.dubbo.rpc.cluster.Router`
+
+## 已知扩展
+
+* `org.apache.dubbo.rpc.cluster.router.ScriptRouterFactory`
+* `org.apache.dubbo.rpc.cluster.router.FileRouterFactory`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxRouterFactory.java (实现LoadBalance接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.rpc.cluster.RouterFactory (纯文本文件,内容为:xxx=com.xxx.XxxRouterFactory)
+
+```
+
+XxxRouterFactory.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.rpc.cluster.RouterFactory;
+import org.apache.dubbo.rpc.Invoker;
+import org.apache.dubbo.rpc.Invocation;
+import org.apache.dubbo.rpc.RpcException;
+
+public class XxxRouterFactory implements RouterFactory {
+ public <T> List<Invoker<T>> select(List<Invoker<T>> invokers, Invocation invocation) throws RpcException {
+ // ...
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.rpc.cluster.RouterFactory:
+
+```properties
+xxx=com.xxx.XxxRouterFactory
+```
+
+
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/serialize.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/serialize.md
new file mode 100644
index 0000000..fcc1358
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/serialize.md
@@ -0,0 +1,72 @@
+# 序列化扩展
+
+## 扩展说明
+
+将对象转成字节流,用于网络传输,以及将字节流转为对象,用于在收到字节流数据后还原成对象。
+
+## 扩展接口
+
+* `org.apache.dubbo.common.serialize.Serialization`
+* `org.apache.dubbo.common.serialize.ObjectInput`
+* `org.apache.dubbo.common.serialize.ObjectOutput`
+
+## 扩展配置
+
+```xml
+<!-- 协议的序列化方式 -->
+<dubbo:protocol serialization="xxx" />
+<!-- 缺省值设置,当<dubbo:protocol>没有配置serialization时,使用此配置 -->
+<dubbo:provider serialization="xxx" />
+```
+
+## 已知扩展
+
+* `org.apache.dubbo.common.serialize.dubbo.DubboSerialization`
+* `org.apache.dubbo.common.serialize.hessian.Hessian2Serialization`
+* `org.apache.dubbo.common.serialize.java.JavaSerialization`
+* `org.apache.dubbo.common.serialize.java.CompactedJavaSerialization`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxSerialization.java (实现Serialization接口)
+ |-XxxObjectInput.java (实现ObjectInput接口)
+ |-XxxObjectOutput.java (实现ObjectOutput接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.common.serialize.Serialization (纯文本文件,内容为:xxx=com.xxx.XxxSerialization)
+```
+
+XxxSerialization.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.common.serialize.Serialization;
+import org.apache.dubbo.common.serialize.ObjectInput;
+import org.apache.dubbo.common.serialize.ObjectOutput;
+
+
+public class XxxSerialization implements Serialization {
+ public ObjectOutput serialize(Parameters parameters, OutputStream output) throws IOException {
+ return new XxxObjectOutput(output);
+ }
+ public ObjectInput deserialize(Parameters parameters, InputStream input) throws IOException {
+ return new XxxObjectInput(input);
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.common.serialize.Serialization:
+
+```properties
+xxx=com.xxx.XxxSerialization
+```
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/status-checker.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/status-checker.md
new file mode 100644
index 0000000..45aa1b0
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/status-checker.md
@@ -0,0 +1,64 @@
+# 状态检查扩展
+
+## 扩展说明
+
+检查服务依赖各种资源的状态,此状态检查可同时用于 telnet 的 status 命令和 hosting 的 status 页面。
+
+## 扩展接口
+
+`org.apache.dubbo.common.status.StatusChecker`
+
+## 扩展配置
+
+```xml
+<dubbo:protocol status="xxx,yyy" />
+<!-- 缺省值设置,当<dubbo:protocol>没有配置status属性时,使用此配置 -->
+<dubbo:provider status="xxx,yyy" />
+```
+
+## 已知扩展
+
+* `org.apache.dubbo.common.status.support.MemoryStatusChecker`
+* `org.apache.dubbo.common.status.support.LoadStatusChecker`
+* `org.apache.dubbo.rpc.dubbo.status.ServerStatusChecker`
+* `org.apache.dubbo.rpc.dubbo.status.ThreadPoolStatusChecker`
+* `org.apache.dubbo.registry.directory.RegistryStatusChecker`
+* `org.apache.dubbo.rpc.config.spring.status.SpringStatusChecker`
+* `org.apache.dubbo.rpc.config.spring.status.DataSourceStatusChecker`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxStatusChecker.java (实现StatusChecker接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.common.status.StatusChecker (纯文本文件,内容为:xxx=com.xxx.XxxStatusChecker)
+```
+
+XxxStatusChecker.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.common.status.StatusChecker;
+
+public class XxxStatusChecker implements StatusChecker {
+ public Status check() {
+ // ...
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.common.status.StatusChecker:
+
+```properties
+xxx=com.xxx.XxxStatusChecker
+```
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/telnet-handler.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/telnet-handler.md
new file mode 100644
index 0000000..9e19b3d
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/telnet-handler.md
@@ -0,0 +1,77 @@
+# Telnet 命令扩展
+
+## 扩展说明
+
+所有服务器均支持 telnet 访问,用于人工干预。
+
+## 扩展接口
+
+`org.apache.dubbo.remoting.telnet.TelnetHandler`
+
+## 扩展配置
+
+```xml
+<dubbo:protocol telnet="xxx,yyy" />
+<!-- 缺省值设置,当<dubbo:protocol>没有配置telnet属性时,使用此配置 -->
+<dubbo:provider telnet="xxx,yyy" />
+```
+
+## 已知扩展
+
+* `org.apache.dubbo.remoting.telnet.support.ClearTelnetHandler`
+* `org.apache.dubbo.remoting.telnet.support.ExitTelnetHandler`
+* `org.apache.dubbo.remoting.telnet.support.HelpTelnetHandler`
+* `org.apache.dubbo.remoting.telnet.support.StatusTelnetHandler`
+* `org.apache.dubbo.rpc.dubbo.telnet.ListTelnetHandler`
+* `org.apache.dubbo.rpc.dubbo.telnet.ChangeTelnetHandler`
+* `org.apache.dubbo.rpc.dubbo.telnet.CurrentTelnetHandler`
+* `org.apache.dubbo.rpc.dubbo.telnet.InvokeTelnetHandler`
+* `org.apache.dubbo.rpc.dubbo.telnet.TraceTelnetHandler`
+* `org.apache.dubbo.rpc.dubbo.telnet.CountTelnetHandler`
+* `org.apache.dubbo.rpc.dubbo.telnet.PortTelnetHandler`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxTelnetHandler.java (实现TelnetHandler接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.remoting.telnet.TelnetHandler (纯文本文件,内容为:xxx=com.xxx.XxxTelnetHandler)
+```
+
+XxxTelnetHandler.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.remoting.telnet.TelnetHandler;
+
+@Help(parameter="...", summary="...", detail="...")
+
+public class XxxTelnetHandler implements TelnetHandler {
+ public String telnet(Channel channel, String message) throws RemotingException {
+ // ...
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.remoting.telnet.TelnetHandler:
+
+```properties
+xxx=com.xxx.XxxTelnetHandler
+```
+
+## 用法
+
+```sh
+telnet 127.0.0.1 20880
+dubbo> xxx args
+```
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/threadpool.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/threadpool.md
new file mode 100644
index 0000000..6d06c60
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/threadpool.md
@@ -0,0 +1,61 @@
+# 线程池扩展
+
+## 扩展说明
+
+服务提供方线程程实现策略,当服务器收到一个请求时,需要在线程池中创建一个线程去执行服务提供方业务逻辑。
+
+## 扩展接口
+
+`org.apache.dubbo.common.threadpool.ThreadPool`
+
+## 扩展配置
+
+```xml
+<dubbo:protocol threadpool="xxx" />
+<!-- 缺省值设置,当<dubbo:protocol>没有配置threadpool时,使用此配置 -->
+<dubbo:provider threadpool="xxx" />
+```
+
+## 已知扩展
+
+* `org.apache.dubbo.common.threadpool.FixedThreadPool`
+* `org.apache.dubbo.common.threadpool.CachedThreadPool`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxThreadPool.java (实现ThreadPool接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.common.threadpool.ThreadPool (纯文本文件,内容为:xxx=com.xxx.XxxThreadPool)
+```
+
+XxxThreadPool.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.common.threadpool.ThreadPool;
+import java.util.concurrent.Executor;
+
+public class XxxThreadPool implements ThreadPool {
+ public Executor getExecutor() {
+ // ...
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.common.threadpool.ThreadPool:
+
+```properties
+xxx=com.xxx.XxxThreadPool
+```
+
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/impls/validation.md b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/validation.md
new file mode 100644
index 0000000..643a7b9
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/impls/validation.md
@@ -0,0 +1,75 @@
+# 验证扩展
+
+## 扩展说明
+
+参数验证扩展点。
+
+## 扩展接口
+
+`org.apache.dubbo.validation.Validation`
+
+## 扩展配置
+
+```xml
+<dubbo:service validation="xxx,yyy" />
+<!-- 缺省值设置,当<dubbo:service>没有配置validation属性时,使用此配置 -->
+<dubbo:provider validation="xxx,yyy" />
+```
+
+## 已知扩展
+
+`org.apache.dubbo.validation.support.jvalidation.JValidation`
+
+## 扩展示例
+
+Maven 项目结构:
+
+```
+src
+ |-main
+ |-java
+ |-com
+ |-xxx
+ |-XxxValidation.java (实现Validation接口)
+ |-resources
+ |-META-INF
+ |-dubbo
+ |-org.apache.dubbo.validation.Validation (纯文本文件,内容为:xxx=com.xxx.XxxValidation)
+```
+
+XxxValidation.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.validation.Validation;
+
+public class XxxValidation implements Validation {
+ public Object getValidator(URL url) {
+ // ...
+ }
+}
+```
+
+XxxValidator.java:
+
+```java
+package com.xxx;
+
+import org.apache.dubbo.validation.Validator;
+
+public class XxxValidator implements Validator {
+ public XxxValidator(URL url) {
+ // ...
+ }
+ public void validate(Invocation invocation) throws Exception {
+ // ...
+ }
+}
+```
+
+META-INF/dubbo/org.apache.dubbo.validation.Validation:
+
+```properties
+xxx=com.xxx.XxxValidation
+```
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/introduction.md b/doc-archive/v2.7.3/docs/zh-cn/dev/introduction.md
new file mode 100644
index 0000000..86aeeb0
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/introduction.md
@@ -0,0 +1 @@
+这里增加《开发指南》的内容
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/principals/code-detail.md b/doc-archive/v2.7.3/docs/zh-cn/dev/principals/code-detail.md
new file mode 100644
index 0000000..956bbea
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/principals/code-detail.md
@@ -0,0 +1,35 @@
+# 魔鬼在细节
+
+> http://javatar.iteye.com/blog/1056664
+
+最近一直担心如果 Dubbo 分布式服务框架维护人员增多或变更,会出现质量的下降的问题, 我在想,有没有什么规则是需要大家共同遵守的。根据平时写代码时的一习惯,总结了以下在写代码过程中,尤其是框架代码,要时刻牢记的细节。可能下面要讲的这些,大家都会觉得很简单,很基础,但要做到时刻牢记。在每一行代码中都考虑这些因素,是需要很大耐心的, 大家经常说,魔鬼在细节中,确实如此。
+
+## 防止空指针和下标越界
+
+这是我最不喜欢看到的异常,尤其在核心框架中,我更愿看到信息详细的参数不合法异常。这也是一个编写健壮程序的开发人员,在写每一行代码都应在潜意识中防止的异常。基本上要能确保每一次写完的代码,在不测试的情况下,都不会出现这两个异常才算合格。
+
+## 保证线程安全性和可见性
+
+对于框架的开发人员,对线程安全性和可见性的深入理解是最基本的要求。需要开发人员,在写每一行代码时都应在潜意识中确保其正确性。因为这种代码,在小并发下做功能测试时,会显得很正常。但在高并发下就会出现莫明其妙的问题,而且场景很难重现,极难排查。
+
+## 尽早失败和前置断言
+
+尽早失败也应该成为潜意识,在有传入参数和状态变化时,均在入口处全部断言。一个不合法的值和状态,在第一时间就应报错,而不是等到要用时才报错。因为等到要用时,可能前面已经修改其它相关状态,而在程序中很少有人去处理回滚逻辑。这样报错后,其实内部状态可能已经混乱,极易在一个隐蔽分支上引发程序不可恢复。
+
+## 分离可靠操作和不可靠操作
+
+这里的可靠是狭义的指是否会抛出异常或引起状态不一致,比如,写入一个线程安全的 Map,可以认为是可靠的,而写入数据库等,可以认为是不可靠的。开发人员必须在写每一行代码时,都注意它的可靠性与否,在代码中尽量划分开,并对失败做异常处理,并为容错,自我保护,自动恢复或切换等补偿逻辑提供清晰的切入点,保证后续增加的代码不至于放错位置,而导致原先的容错处理陷入混乱。
+
+## 异常防御,但不忽略异常
+
+这里讲的异常防御,指的是对非必须途径上的代码进行最大限度的容忍,包括程序上的 BUG,比如:获取程序的版本号,会通过扫描 Manifest 和 jar 包名称抓取版本号,这个逻辑是辅助性的,但代码却不少,初步测试也没啥问题,但应该在整个 getVersion() 中加上一个全函数的 try-catch 打印错误日志,并返回基本版本,因为 getVersion() 可能存在未知特定场景异常,或被其他的开发人员误修改逻辑(但一般人员不会去掉 try-catch),而如果它抛出异常会导致主流程异常,这是我们不希望看到的。但这里要控制个度,不要随意 try-catch,更不要无声无息的吃掉异常。
+
+## 缩小可变域和尽量 final
+如果一个类可以成为不变类(Immutable Class),就优先将它设计成不变类。不变类有天然的并发共享优势,减少同步或复制,而且可以有效帮忙分析线程安全的范围。就算是可变类,对于从构造函数传入的引用,在类中持有时,最好将字段 final,以免被中途误修改引用。不要以为这个字段是私有的,这个类的代码都是我自己写的,不会出现对这个字段的重新赋值。要考虑的一个因素是,这个代码可能被其他人修改,他不知道你的这个弱约定,final 就是一个不变契约。
+
+## 降低修改时的误解性,不埋雷
+
+前面不停的提到代码被其他人修改,这也开发人员要随时紧记的。这个其他人包括未来的自己,你要总想着这个代码可能会有人去改它。我应该给修改的人一点什么提示,让他知道我现在的设计意图,而不要在程序里面加潜规则,或埋一些容易忽视的雷,比如:你用 null 表示不可用,size 等于 0 表示黑名单,这就是一个雷,下一个修改者,包括你自己,都不会记得有这样的约定,可能后面为了改某个其它 BUG,不小心改到了这里,直接引爆故障。对于这个例子,一个原则就是永远不要区分 null 引用和 empty 值。
+
+## 提高代码的可测性
+这里的可测性主要指 Mock 的容易程度,和测试的隔离性。至于测试的自动性,可重复性,非偶然性,无序性,完备性(全覆盖),轻量性(可快速执行),一般开发人员,加上 JUnit 等工具的辅助基本都能做到,也能理解它的好处,只是工作量问题。这里要特别强调的是测试用例的单一性(只测目标类本身)和隔离性(不传染失败)。现在的测试代码,过于强调完备性,大量重复交叉测试,看起来没啥坏处,但测试代码越多,维护代价越高。经常出现的问题是,修改一行代码或加一个判断条件,引起 100 多个测试用例不通过。时间一紧,谁有这个闲功夫去改这么多形态各异的测试用例?久而久之,这个测试代码就已经不能真实反应代码现在的状况,很多时候会被迫绕过。最好的情况是,修改一行代码,有且只有一行测试代码不通过。如果修改了代码而测试用�
�还能通过,那也不行,表示测试没有覆盖到。另外,可 Mock 性是隔离的基础,把间接依赖的逻辑屏蔽掉。可 Mock 性的一个最大的杀手就是静态方法,尽量少用。
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/principals/configuration.md b/doc-archive/v2.7.3/docs/zh-cn/dev/principals/configuration.md
new file mode 100644
index 0000000..4b2d6c1
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/principals/configuration.md
@@ -0,0 +1,97 @@
+# 配置设计
+
+> http://javatar.iteye.com/blog/949527
+
+Dubbo 现在的设计是完全无侵入,也就是使用者只依赖于配置契约。经过多个版本的发展,为了满足各种需求场景,配置越来越多。为了保持兼容,配置只增不减,里面潜伏着各种风格,约定,规则。新版本也将配置做了一次调整,将想到的一些记在这,备忘。
+
+## 配置分类
+
+首先,配置的用途是有多种的,大致可以分为:
+
+0. 环境配置,比如:连接数,超时等配置。
+0. 描述配置,比如:服务接口描述,服务版本等。
+0. 扩展配置,比如:协议扩展,策略扩展等。
+
+## 配置格式
+
+通常环境配置,用 properties 配置会比较方便,因为都是一些离散的简单值,用 key-value 配置可以减少配置的学习成本。
+
+而描述配置,通常信息比较多,甚至有层次关系,用 xml 配置会比较方便,因为树结构的配置表现力更强。如果非常复杂,也可以考自定义 DSL 做为配置。有时候这类配置也可以用 Annotation 代替, 因为这些配置和业务逻辑相关,放在代码里也是合理的。
+
+另外扩展配置,可能不尽相同。如果只是策略接口实现类替换,可以考虑 properties 等结构。如果有复杂的生命周期管理,可能需要 XML 等配置。有时候扩展会通过注册接口的方式提供。
+
+## 配置加载
+
+对于环境配置,在 java 世界里,比较常规的做法,是在 classpath 下约定一个以项目为名称的 properties 配置,比如:log4j.properties,velocity.properties等。产品在初始化时,自动从 classpath 下加载该配置。我们平台的很多项目也使用类似策略,如:dubbo.properties,comsat.xml 等。这样有它的优势,就是基于约定,简化了用户对配置加载过程的干预。但同样有它的缺点,当 classpath 存在同样的配置时,可能误加载,以及在 ClassLoader 隔离时,可能找不到配置,并且,当用户希望将配置放到统一的目录时,不太方便。
+
+而对于描述配置,因为要参与业务逻辑,通常会嵌到应用的生命周期管理中。现在使用 spring 的项目越来越多,直接使用 spring 配置的比较普遍,而且 spring 允许自定义 schema,配置简化后很方便。当然,也有它的缺点,就是强依赖 spring,可以提编程接口做了配套方案。
+
+在 Dubbo 既存在描述配置也有环境配置。一部分用 spring 的 schema 做配置加载,一部分从 classpath 扫描 properties 做配置加载。在新版本中做了一个优先级约定,统一以 spring 的 schema 驱动配置加载,dubbo.properties作为配置补充。
+
+同时,在 Spring 的场景下,除了使用 schema 外,还支持完全以 application.properties 的方式配置:
+
+```xml
+# Dubbo Application
+## The default value of dubbo.application.name is ${spring.application.name}
+## dubbo.application.name=${spring.application.name}
+
+# Dubbo Protocol
+dubbo.protocol.name=dubbo
+dubbo.protocol.port=12345
+
+## Dubbo Registry
+dubbo.registry.address=N/A
+```
+
+扩展配置,通常对配置的聚合要求比较高。因为产品需要发现第三方实现,将其加入产品内部。在 java 世界里,通常是约定在每个 jar 包下放一个指定文件加载,比如:eclipse 的 plugin.xml,struts2 的 struts-plugin.xml 等,这类配置可以考虑 java 标准的服务发现机制,即在 jar 包的 META-INF/services 下放置接口类全名文件,内容为每行一个实现类类名,就像 jdk 中的加密算法扩展,脚本引擎扩展,新的 JDBC 驱动等,都是采用这种方式。参见:[ServiceProvider 规范](https://docs.oracle.com/javase/tutorial/sound/SPI-intro.html)。
+
+Dubbo 旧版本通过约定在每个 jar 包下,放置名为 dubbo-context.xml 的 spring 配置进行扩展与集成,新版本改成用 jdk 自带的 META-INF/services 方式,去掉过多的 spring 依赖。
+
+## 可编程配置
+
+配置的可编程性是非常必要的,不管你以何种方式加载配置文件,都应该提供一个编程的配置方式,允许用户不使用配置文件,直接用代码完成配置过程。因为一个产品,尤其是组件类产品,通常需要和其它产品协作使用,当用户集成你的产品时,可能需要适配配置方式。
+
+Dubbo 新版本提供了与 xml 配置一对一的配置类,如:ServiceConfig 对应 `<dubbo:service />`,并且属性也一对一,这样有利于文件配置与编程配置的一致性理解,减少学习成本。
+
+## 配置缺省值
+
+配置的缺省值,通常是设置一个常规环境的合理值,这样可以减少用户的配置量。通常建议以线上环境为参考值,开发环境可以通过修改配置适应。缺省值的设置,最好在最外层的配置加载就做处理。程序底层如果发现配置不正确,就应该直接报错,容错在最外层做。如果在程序底层使用时,发现配置值不合理,就填一个缺省值,很容易掩盖表面问题,而引发更深层次的问题。并且配置的中间传递层,很可能并不知道底层使用了一个缺省值,一些中间的检测条件就可能失效。Dubbo 就出现过这样的问题,中间层用“地址”做为缓存 Key, 而底层,给“地址”加了一个缺省端口号,导致不加端口号的“地址”和加了缺省端口的“地址”并没有使用相同的缓存。
+
+## 配置一致性
+
+配置总会隐含一些风格或潜规则,应尽可能保持其一致性。比如:很多功能都有开关,然后有一个配置值:
+
+0. 是否使用注册中心,注册中心地址。
+0. 是否允许重试,重试次数。
+
+你可以约定:
+
+0. 每个都是先配置一个 boolean 类型的开关,再配置一个值。
+0. 用一个无效值代表关闭,N/A地址,0重试次数等。
+
+不管选哪种方式,所有配置项,都应保持同一风格,Dubbo 选的是第二种。相似的还有,超时时间,重试时间,定时器间隔时间。如果一个单位是秒,另一个单位是毫秒(C3P0的配置项就是这样),配置人员会疯掉。
+
+## 配置覆盖
+
+提供配置时,要同时考虑开发人员,测试人员,配管人员,系统管理员。测试人员是不能修改代码的,而测试的环境很可能较为复杂,需要为测试人员留一些“后门”,可以在外围修改配置项。就像 spring 的 PropertyPlaceholderConfigurer 配置,支持 `SYSTEM_PROPERTIES_MODE_OVERRIDE`,可以通过 JVM 的 -D 参数,或者像 hosts 一样约定一个覆盖配置文件,在程序外部,修改部分配置,便于测试。
+
+
+Dubbo 支持通过 JVM 参数 `-Dcom.xxx.XxxService=dubbo://10.1.1.1:1234
+` 直接使远程服务调用绕过注册中心,进行点对点测试。还有一种情况,开发人员增加配置时,都会按线上的部署情况做配置,如:`<dubbo:registry address="${dubbo.registry.address}" />` 因为线上只有一个注册中心,这样的配置是没有问题的,而测试环境可能有两个注册中心,测试人员不可能去修改配置,改为:
+`<dubbo:registry address="${dubbo.registry.address1}" />`,
+`<dubbo:registry address="${dubbo.registry.address2}" />`,所以这个地方,Dubbo 支持在 ${dubbo.registry.address} 的值中,通过竖号分隔多个注册中心地址,用于表示多注册中心地址。
+
+## 配置继承
+
+配置也存在“重复代码”,也存在“泛化与精化”的问题。比如:Dubbo 的超时时间设置,每个服务,每个方法,都应该可以设置超时时间。但很多服务不关心超时,如果要求每个方法都配置,是不现实的。所以 Dubbo 采用了方法超时继承服务超时,服务超时再继承缺省超时,没配置时,一层层向上查找。
+
+另外,Dubbo 旧版本所有的超时时间,重试次数,负载均衡策略等都只能在服务消费方配置。但实际使用过程中发现,服务提供方比消费方更清楚,但这些配置项是在消费方执行时才用到的。新版本,就加入了在服务提供方也能配这些参数,通过注册中心传递到消费方,
+做为参考值,如果消费方没有配置,就以提供方的配置为准,相当于消费方继承了提供方的建议配置值。而注册中心在传递配置时,也可以在中途修改配置,这样就达到了治理的目的,继承关系相当于:服务消费者 --> 注册中心 --> 服务提供者
+
+
+
+## 配置向后兼容
+
+向前兼容很好办,你只要保证配置只增不减,就基本上能保证向前兼容。但向后兼容,也是要注意的,要为后续加入新的配置项做好准备。如果配置出现一个特殊配置,就应该为这个“特殊”情况约定一个兼容规则,因为这个特殊情况,很有可能在以后还会发生。比如:有一个配置文件是保存“服务=地址”映射关系的,其中有一行特殊,保存的是“注册中心=地址”。现在程序加载时,约定“注册中心”这个Key是特殊的,做特别处理,其它的都是“服务”。然而,新版本发现,要加一项“监控中心=地址”,这时,旧版本的程序会把“监控中心”做为“服务”处理,因为旧代码是不能改的,兼容性就很会很麻烦。如果先前约定“特殊标识+XXX”为特殊处理,后续就会方便很多。
+
+向后兼容性,可以多向HTML5学习,参见:[HTML5设计原理](http://javatar.iteye.com/blog/949390)
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/principals/dummy.md b/doc-archive/v2.7.3/docs/zh-cn/dev/principals/dummy.md
new file mode 100644
index 0000000..9863d23
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/principals/dummy.md
@@ -0,0 +1,204 @@
+# 防痴呆设计
+
+> http://javatar.iteye.com/blog/804187
+
+最近有点痴呆,因为解决了太多的痴呆问题。服务框架实施面超来超广,已有 50 多个项目在使用,每天都要去帮应用查问题,来来回回,发现大部分都是配置错误,或者重复的文件或类,或者网络不通等,所以准备在新版本中加入防痴呆设计。估且这么叫吧,可能很简单,但对排错速度还是有点帮助,希望能抛砖引玉,也希望大家多给力,想出更多的防范措施共享出来。
+
+## 检查重复的jar包
+
+最痴呆的问题,就是有多个版本的相同jar包,会出现新版本的 A 类,调用了旧版本的 B 类,而且和JVM加载顺序有关,问题带有偶然性,误导性,遇到这种莫名其妙的问题,最头疼,所以,第一条,先把它防住,在每个 jar 包中挑一个一定会加载的类,加上重复类检查,给个示例:
+
+```java
+static {
+ Duplicate.checkDuplicate(Xxx.class);
+}
+```
+
+检查重复工具类:
+
+```java
+public final class Duplicate {
+
+ private Duplicate() {}
+
+ public static void checkDuplicate(Class cls) {
+ checkDuplicate(cls.getName().replace('.', '/') + ".class");
+ }
+
+ public static void checkDuplicate(String path) {
+ try {
+ // 在ClassPath搜文件
+ Enumeration urls = Thread.currentThread().getContextClassLoader().getResources(path);
+ Set files = new HashSet();
+ while (urls.hasMoreElements()) {
+ URL url = urls.nextElement();
+ if (url != null) {
+ String file = url.getFile();
+ if (file != null && file.length() > 0) {
+ files.add(file);
+ }
+ }
+ }
+ // 如果有多个,就表示重复
+ if (files.size() > 1) {
+ logger.error("Duplicate class " + path + " in " + files.size() + " jar " + files);
+ }
+ } catch (Throwable e) { // 防御性容错
+ logger.error(e.getMessage(), e);
+ }
+ }
+
+}
+```
+
+## 检查重复的配置文件
+
+配置文件加载错,也是经常碰到的问题。用户通常会和你说:“我配置的很正确啊,不信我发给你看下,但就是报错”。然后查一圈下来,原来他发过来的配置根本没加载,平台很多产品都会在 classpath 下放一个约定的配置,如果项目中有多个,通常会取JVM加载的第一个,为了不被这么低级的问题折腾,和上面的重复jar包一样,在配置加载的地方,加上:
+
+```java
+Duplicate.checkDuplicate("xxx.properties");
+```
+
+## 检查所有可选配置
+
+必填配置估计大家都会检查,因为没有的话,根本没法运行。但对一些可选参数,也应该做一些检查,比如:服务框架允许通过注册中心关联服务消费者和服务提供者,也允许直接配置服务提供者地址点对点直连,这时候,注册中心地址是可选的,但如果没有配点对点直连配置,注册中心地址就一定要配,这时候也要做相应检查。
+
+## 异常信息给出解决方案
+
+在给应用排错时,最怕的就是那种只有简单的一句错误描述,啥信息都没有的异常信息。比如上次碰到一个 Failed to get session 异常,就这几个单词,啥都没有,哪个 session 出错? 什么原因 Failed? 看了都快疯掉,因是线上环境不好调试,而且有些场景不是每次都能重现。异常最基本要带有上下文信息,包括操作者,操作目标,原因等,最好的异常信息,应给出解决方案,比如上面可以给出:"从 10.20.16.3 到 10.20.130.20:20880 之间的网络不通,请在 10.20.16.3 使用 telnet 10.20.130.20 20880 测试一下网络,如果是跨机房调用,可能是防火墙阻挡,请联系 SA 开通访问权限" 等等,上面甚至可以根据 IP 段判断是不是跨机房。另外一个例子,是 spring-web 的 context 加载,如果在 getBean 时 spring 没有被启动,spring 会报一个错,错误信息写着:请在 web.xml 中加入: `<listener>...<ini
t-param>...`,多好的同学,看到错误的人复制 [...]
+或者把平时支持应用时遇到的问题及解决办法都写到异常信息里。
+
+## 日志信息包含环境信息
+
+每次应用一出错,应用的开发或测试就会把出错信息发过来,询问原因,这时候我都会问一大堆套话,用的哪个版本呀?是生产环境还是开发测试环境?哪个注册中心呀?哪个项目中的?哪台机器呀?哪个服务? 累啊,最主要的是,有些开发或测试人员根本分不清,没办法,只好提供上门服务,浪费的时间可不是浮云,所以,日志中最好把需要的环境信息一并打进去,最好给日志输出做个包装,统一处理掉,免得忘了。包装Logger接口如:
+
+```java
+public void error(String msg, Throwable e) {
+ delegate.error(msg + " on server " + InetAddress.getLocalHost() + " using version " + Version.getVersion(), e);
+}
+```
+
+获取版本号工具类:
+
+```java
+public final class Version {
+
+ private Version() {}
+
+ private static final Logger logger = LoggerFactory.getLogger(Version.class);
+
+ private static final Pattern VERSION_PATTERN = Pattern.compile("([0-9][0-9\\.\\-]*)\\.jar");
+
+ private static final String VERSION = getVersion(Version.class, "2.0.0");
+
+ public static String getVersion(){
+ return VERSION;
+ }
+
+ public static String getVersion(Class cls, String defaultVersion) {
+ try {
+ // 首先查找MANIFEST.MF规范中的版本号
+ String version = cls.getPackage().getImplementationVersion();
+ if (version == null || version.length() == 0) {
+ version = cls.getPackage().getSpecificationVersion();
+ }
+ if (version == null || version.length() == 0) {
+ // 如果MANIFEST.MF规范中没有版本号,基于jar包名获取版本号
+ String file = cls.getProtectionDomain().getCodeSource().getLocation().getFile();
+ if (file != null && file.length() > 0 && file.endsWith(".jar")) {
+ Matcher matcher = VERSION_PATTERN.matcher(file);
+ while (matcher.find() && matcher.groupCount() > 0) {
+ version = matcher.group(1);
+ }
+ }
+ }
+ // 返回版本号,如果为空返回缺省版本号
+ return version == null || version.length() == 0 ? defaultVersion : version;
+ } catch (Throwable e) { // 防御性容错
+ // 忽略异常,返回缺省版本号
+ logger.error(e.getMessage(), e);
+ return defaultVersion;
+ }
+ }
+
+}
+```
+
+## kill 之前先 dump
+
+每次线上环境一出问题,大家就慌了,通常最直接的办法回滚重启,以减少故障时间,这样现场就被破坏了,要想事后查问题就麻烦了,有些问题必须在线上的大压力下才会发生,线下测试环境很难重现,不太可能让开发或 Appops 在重启前,先手工将出错现场所有数据备份一下,所以最好在 kill 脚本之前调用 dump,进行自动备份,这样就不会有人为疏忽。dump脚本示例:
+
+```sh
+JAVA_HOME=/usr/java
+OUTPUT_HOME=~/output
+DEPLOY_HOME=`dirname $0`
+HOST_NAME=`hostname`
+
+DUMP_PIDS=`ps --no-heading -C java -f --width 1000 | grep "$DEPLOY_HOME" |awk '{print $2}'`
+if [ -z "$DUMP_PIDS" ]; then
+ echo "The server $HOST_NAME is not started!"
+ exit 1;
+fi
+
+DUMP_ROOT=$OUTPUT_HOME/dump
+if [ ! -d $DUMP_ROOT ]; then
+ mkdir $DUMP_ROOT
+fi
+
+DUMP_DATE=`date +%Y%m%d%H%M%S`
+DUMP_DIR=$DUMP_ROOT/dump-$DUMP_DATE
+if [ ! -d $DUMP_DIR ]; then
+ mkdir $DUMP_DIR
+fi
+
+echo -e "Dumping the server $HOST_NAME ...\c"
+for PID in $DUMP_PIDS ; do
+ $JAVA_HOME/bin/jstack $PID > $DUMP_DIR/jstack-$PID.dump 2>&1
+ echo -e ".\c"
+ $JAVA_HOME/bin/jinfo $PID > $DUMP_DIR/jinfo-$PID.dump 2>&1
+ echo -e ".\c"
+ $JAVA_HOME/bin/jstat -gcutil $PID > $DUMP_DIR/jstat-gcutil-$PID.dump 2>&1
+ echo -e ".\c"
+ $JAVA_HOME/bin/jstat -gccapacity $PID > $DUMP_DIR/jstat-gccapacity-$PID.dump 2>&1
+ echo -e ".\c"
+ $JAVA_HOME/bin/jmap $PID > $DUMP_DIR/jmap-$PID.dump 2>&1
+ echo -e ".\c"
+ $JAVA_HOME/bin/jmap -heap $PID > $DUMP_DIR/jmap-heap-$PID.dump 2>&1
+ echo -e ".\c"
+ $JAVA_HOME/bin/jmap -histo $PID > $DUMP_DIR/jmap-histo-$PID.dump 2>&1
+ echo -e ".\c"
+ if [ -r /usr/sbin/lsof ]; then
+ /usr/sbin/lsof -p $PID > $DUMP_DIR/lsof-$PID.dump
+ echo -e ".\c"
+ fi
+done
+if [ -r /usr/bin/sar ]; then
+/usr/bin/sar > $DUMP_DIR/sar.dump
+echo -e ".\c"
+fi
+if [ -r /usr/bin/uptime ]; then
+/usr/bin/uptime > $DUMP_DIR/uptime.dump
+echo -e ".\c"
+fi
+if [ -r /usr/bin/free ]; then
+/usr/bin/free -t > $DUMP_DIR/free.dump
+echo -e ".\c"
+fi
+if [ -r /usr/bin/vmstat ]; then
+/usr/bin/vmstat > $DUMP_DIR/vmstat.dump
+echo -e ".\c"
+fi
+if [ -r /usr/bin/mpstat ]; then
+/usr/bin/mpstat > $DUMP_DIR/mpstat.dump
+echo -e ".\c"
+fi
+if [ -r /usr/bin/iostat ]; then
+/usr/bin/iostat > $DUMP_DIR/iostat.dump
+echo -e ".\c"
+fi
+if [ -r /bin/netstat ]; then
+/bin/netstat > $DUMP_DIR/netstat.dump
+echo -e ".\c"
+fi
+echo "OK!"
+```
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/principals/expansibility.md b/doc-archive/v2.7.3/docs/zh-cn/dev/principals/expansibility.md
new file mode 100644
index 0000000..8ab6583
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/principals/expansibility.md
@@ -0,0 +1,18 @@
+# 谈谈扩充式扩展与增量式扩展
+
+> http://javatar.iteye.com/blog/690845
+
+
+我们平台的产品越来越多,产品的功能也越来越多。平台的产品为了适应各 BU 和部门以及产品线的需求,势必会将很多不相干的功能凑在一起,客户可以选择性的使用。为了兼容更多的需求,每个产品,每个框架,都在不停的扩展,而我们经常会选择一些扩展的扩展方式,也就是将新旧功能扩展成一个通用实现。我想讨论是,有些情况下也可以考虑增量式的扩展方式,也就是保留原功能的简单性,新功能独立实现。我最近一直做分布式服务框架的开发,就拿我们项目中的问题开涮吧。
+
+比如:远程调用框架,肯定少不了序列化功能,功能很简单,就是把流转成对象,对象转成流。但因有些地方可能会使用 osgi,这样序列化时,IO 所在的 ClassLoader 可能和业务方的 ClassLoader 是隔离的。需要将流转换成 byte[] 数组,然后传给业务方的 ClassLoader 进行序列化。为了适应 osgi 需求,把原来非 osgi 与 osgi 的场景扩展了一下,这样,不管是不是 osgi 环境,都先将流转成 byte[] 数组,拷贝一次。然而,大部分场景都用不上 osgi,却为 osgi 付出了代价。而如果采用增量式扩展方式,非 osgi 的代码原封不动,再加一个 osgi 的实现,要用 osgi 的时候,直接依赖 osgi 实现即可。
+
+再比如:最开始,远程服务都是基于接口方法,进行透明化调用的。这样,扩展接口就是, invoke(Method method, Object[] args),后来,有了无接口调用的需求,就是没有接口方法也能调用,并将 POJO 对象都转换成 Map 表示。因为 Method 对象是不能直接 new 出来的,我们不自觉选了一个扩展式扩展,把扩展接口改成了 invoke(String methodName, String[] parameterTypes, String returnTypes, Object[] args),导致不管是不是无接口调用,都得把 parameterTypes 从 Class[] 转成 String[]。如果选用增量式扩展,应该是保持原有接口不变,增加一个 GeneralService 接口,里面有一个通用的 invoke() 方法,和其它正常业务上的接口一样的调用方式,扩展接口也不用变,只是 GeneralServiceImpl 的 invoke() 实现会将收到的调用转给目标接口,这样就能将新功能增量到旧功能上,并保持原来结构的简单性。
+
+再再比如:无状态消息发送,很简单,序列化一个对象发过去就行。后来有了同步消息发送需求,需要一个 Request/Response 进行配对,采用扩展式扩展,自然想到,无状态消息其实是一个没有 Response 的 Request,所以在 Request 里加一个 boolean 状态,表示要不要返回 Response。如果再来一个会话消息发送需求,那就再加一个 Session 交互,然后发现,原来同步消息发送是会话消息的一种特殊情况,所有场景都传 Session,不需要 Session 的地方无视即可。
+
+
+
+如果采用增量式扩展,无状态消息发送原封不动,同步消息发送,在无状态消息基础上加一个 Request/Response 处理,会话消息发送,再加一个 SessionRequest/SessionResponse 处理。
+
+
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/principals/extension.md b/doc-archive/v2.7.3/docs/zh-cn/dev/principals/extension.md
new file mode 100644
index 0000000..67ce6b4
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/principals/extension.md
@@ -0,0 +1,136 @@
+# 扩展点重构
+
+> http://javatar.iteye.com/blog/1041832
+
+随着服务化的推广,网站对Dubbo服务框架的需求逐渐增多,Dubbo 的现有开发人员能实现的需求有限,很多需求都被 delay,而网站的同学也希望参与进来,加上领域的推动,所以平台计划将部分项目对公司内部开放,让大家一起来实现,Dubbo 为试点项目之一。
+
+既然要开放,那 Dubbo 就要留一些扩展点,让参与者尽量黑盒扩展,而不是白盒的修改代码,否则分支,质量,合并,冲突都会很难管理。
+
+先看一下 Dubbo 现有的设计:
+
+
+
+这里面虽然有部分扩展接口,但并不能很好的协作,而且扩展点的加载和配置都没有统一处理,所以下面对它进行重构。
+
+## 第一步,微核心,插件式,平等对待第三方
+
+即然要扩展,扩展点的加载方式,首先要统一,微核心+插件式,是比较能达到 OCP 原则的思路。
+
+由一个插件生命周期管理容器,构成微核心,核心不包括任何功能,这样可以确保所有功能都能被替换,并且,框架作者能做到的功能,扩展者也一定要能做到,以保证平等对待第三方,所以,框架自身的功能也要用插件的方式实现,不能有任何硬编码。
+
+通常微核心都会采用 Factory、IoC、OSGi 等方式管理插件生命周期。考虑 Dubbo 的适用面,不想强依赖 Spring 等 IoC 容器。自已造一个小的 IoC 容器,也觉得有点过度设计,所以打算采用最简单的 Factory 方式管理插件。
+
+最终决定采用的是 JDK 标准的 SPI 扩展机制,参见:`java.util.ServiceLoader `,也就是扩展者在 jar 包的 `META-INF/services/` 目录下放置与接口同名的文本文件,内容为接口实现类名,多个实现类名用换行符分隔。比如,需要扩展 Dubbo 的协议,只需在 xxx.jar 中放置文件:`META-INF/services/org.apache.dubbo.rpc.Protocol`,内容为 `com.alibaba.xxx.XxxProtocol`。Dubbo 通过 ServiceLoader 扫描到所有 Protocol 实现。
+
+并约定所有插件,都必须标注:`@Extension("name")`,作为加载后的标识性名称,用于配置选择。
+
+## 第二步,每个扩展点只封装一个变化因子,最大化复用
+
+每个扩展点的实现者,往往都只是关心一件事,现在的扩展点,并没有完全分离。比如:Failover, Route, LoadBalance, Directory 没有完全分开,全由 RoutingInvokerGroup 写死了。
+
+再比如,协议扩展,扩展者可能只是想替换序列化方式,或者只替换传输方式,并且 Remoting 和 Http 也能复用序列化等实现。这样,需为传输方式,客户端实现,服务器端实现,协议头解析,数据序列化,都留出不同扩展点。
+
+拆分后,设计如下:
+
+
+
+
+## 第三步,全管道式设计,框架自身逻辑,均使用截面拦截实现
+
+现在很多的逻辑,都是放在基类中实现,然后通过模板方法回调子类的实现,包括:local, mock, generic, echo, token, accesslog, monitor, count, limit 等等,可以全部拆分使用 Filter 实现,每个功能都是调用链上的一环。 比如:(基类模板方法)
+
+```java
+public abstract AbstractInvoker implements Invoker {
+
+ public Result invoke(Invocation inv) throws RpcException {
+ // 伪代码
+ active ++;
+ if (active > max)
+ wait();
+
+ doInvoke(inv);
+
+ active --;
+ notify();
+ }
+
+ protected abstract Result doInvoke(Invocation inv) throws RpcException
+
+}
+```
+
+改成:(链式过滤器)
+
+```java
+public abstract LimitFilter implements Filter {
+
+ public Result invoke(Invoker chain, Invocation inv) throws RpcException {
+ // 伪代码
+ active ++;
+ if (active > max)
+ wait();
+
+ chain.invoke(inv);
+
+ active --;
+ notify();
+ }
+
+}
+```
+
+## 第四步,最少概念,一致性概念模型
+
+保持尽可能少的概念,有助于理解,对于开放的系统尤其重要。另外,各接口都使用一致的概念模型,能相互指引,并减少模型转换,
+
+比如,Invoker 的方法签名为:
+
+```java
+Result invoke(Invocation invocation) throws RpcException;
+```
+
+而 Exporter 的方法签名为:
+
+```java
+Object invoke(Method method, Object[] args) throws Throwable;
+```
+
+但它们的作用是一样的,只是一个在客户端,一个在服务器端,却采用了不一样的模型类。
+
+再比如,URL 以字符串传递,不停的解析和拼装,没有一个 URL 模型类, 而 URL 的参数,却时而 Map, 时而 Parameters 类包装,
+
+```java
+export(String url)
+createExporter(String host, int port, Parameters params);
+```
+
+使用一致模型:
+
+```java
+export(URL url)
+createExporter(URL url);
+```
+
+再比如,现有的:Invoker, Exporter, InvocationHandler, FilterChain
+ 其实都是 invoke 行为的不同阶段,完全可以抽象掉,统一为 Invoker,减少概念。
+
+## 第五步,分层,组合式扩展,而不是泛化式扩展
+
+原因参见:[谈谈扩充式扩展与增量式扩展](../principals/expansibility.md)。
+
+泛化式扩展指:将扩展点逐渐抽象,取所有功能并集,新加功能总是套入并扩充旧功能的概念。
+
+组合式扩展指:将扩展点正交分解,取所有功能交集,新加功能总是基于旧功能之上实现。
+
+上面的设计,不自觉的就将 Dubbo 现有功能都当成了核心功能。上面的概念包含了 Dubbo 现有 RPC 的所有功能,包括:Proxy, Router, Failover, LoadBalance, Subscriber, Publisher, Invoker, Exporter, Filter 等,
+但这些都是核心吗?踢掉哪些,RPC 一样可以 Run?而哪些又是不能踢掉的?基于这样考虑,可以将 RPC 分解成两个层次,只是 Protocol 和 Invoker 才是 RPC 的核心。其它,包括 Router, Failover, Loadbalance, Subscriber, Publisher 都不核心,而是 Routing。所以,将 Routing 作为 Rpc 核心的一个扩展,设计如下:
+
+
+
+## 第六步,整理,梳理关系
+
+整理后,设计如下:
+
+
+
+
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/principals/general-knowledge.md b/doc-archive/v2.7.3/docs/zh-cn/dev/principals/general-knowledge.md
new file mode 100644
index 0000000..2e76ad9
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/principals/general-knowledge.md
@@ -0,0 +1,69 @@
+# 一些设计上的基本常识
+
+> http://javatar.iteye.com/blog/706098
+
+最近给团队新人讲了一些设计上的常识,可能会对其它的新人也有些帮助,把暂时想到的几条,先记在这里。
+
+## API 与 SPI 分离
+
+框架或组件通常有两类客户,一个是使用者,一个是扩展者。API (Application Programming Interface) 是给使用者用的,而 SPI (Service Provide Interface) 是给扩展者用的。在设计时,尽量把它们隔离开,而不要混在一起。也就是说,使用者是看不到扩展者写的实现的。
+
+比如:一个 Web 框架,它有一个 API 接口叫 Action,里面有个 execute() 方法,是给使用者用来写业务逻辑的。然后,Web 框架有一个 SPI 接口给扩展者控制输出方式,比如用 velocity 模板输出还是用 json 输出等。如果这个 Web 框架使用一个都继承 Action 的 VelocityAction 和一个 JsonAction 做为扩展方式,要用 velocity 模板输出的就继承 VelocityAction,要用 json 输出的就继承 JsonAction,这就是 API 和 SPI 没有分离的反面例子,SPI 接口混在了 API 接口中。
+
+
+
+
+合理的方式是,有一个单独的 Renderer 接口,有 VelocityRenderer 和 JsonRenderer 实现,Web 框架将 Action 的输出转交给 Renderer 接口做渲染输出。
+
+
+
+
+## 服务域/实体域/会话域分离
+
+任何框架或组件,总会有核心领域模型,比如:Spring 的 Bean,Struts 的 Action,Dubbo 的 Service,Napoli 的 Queue 等等。这个核心领域模型及其组成部分称为实体域,它代表着我们要操作的目标本身。实体域通常是线程安全的,不管是通过不变类,同步状态,或复制的方式。
+
+服务域也就是行为域,它是组件的功能集,同时也负责实体域和会话域的生命周期管理,
+比如 Spring 的 ApplicationContext,Dubbo 的 ServiceManager 等。服务域的对象通常会比较重,而且是线程安全的,并以单一实例服务于所有调用。
+
+什么是会话?就是一次交互过程。会话中重要的概念是上下文,什么是上下文?比如我们说:“老地方见”,这里的“老地方”就是上下文信息。为什么说“老地方”对方会知道,因为我们前面定义了“老地方”的具体内容。所以说,上下文通常持有交互过程中的状态变量等。会话对象通常较轻,每次请求都重新创建实例,请求结束后销毁。简而言之:把元信息交由实体域持有,把一次请求中的临时状态由会话域持有,由服务域贯穿整个过程。
+
+
+
+
+## 在重要的过程上设置拦截接口
+
+如果你要写个远程调用框架,那远程调用的过程应该有一个统一的拦截接口。如果你要写一个 ORM 框架,那至少 SQL 的执行过程,Mapping 过程要有拦截接口;如果你要写一个 Web 框架,那请求的执行过程应该要有拦截接口,等等。没有哪个公用的框架可以 Cover 住所有需求,允许外置行为,是框架的基本扩展方式。这样,如果有人想在远程调用前,验证下令牌,验证下黑白名单,统计下日志;如果有人想在 SQL 执行前加下分页包装,做下数据权限控制,统计下 SQL 执行时间;如果有人想在请求执行前检查下角色,包装下输入输出流,统计下请求量,等等,就可以自行完成,而不用侵入框架内部。拦截接口,通常是把过程本身用一个对象封装起来,传给拦截器链,比如:远程调用主过程为 invoke(),那拦截器接口通常为 invoke(Invocation),Invocation 对象封装了
本来要执行过程的上下文,并且 Invocation 里有一个 invoke() 方法,由拦截器决定什么时候执行,同时,Invocation 也代表拦截器行为本身,这样上一拦截器的 Invocation 其实是包装的 [...]
+
+
+
+## 重要的状态的变更发送事件并留出监听接口
+
+这里先要讲一个事件和上面拦截器的区别,拦截器是干预过程的,它是过程的一部分,是基于过程行为的,而事件是基于状态数据的,任何行为改变的相同状态,对事件应该是一致的。事件通常是事后通知,是一个 Callback 接口,方法名通常是过去式的,比如 onChanged()。比如远程调用框架,当网络断开或连上应该发出一个事件,当出现错误也可以考虑发出一个事件,这样外围应用就有可能观察到框架内部的变化,做相应适应。
+
+
+
+## 扩展接口职责尽可能单一,具有可组合性
+
+比如,远程调用框架它的协议是可以替换的。如果只提供一个总的扩展接口,当然可以做到切换协议,但协议支持是可以细分为底层通讯,序列化,动态代理方式等等。如果将接口拆细,正交分解,会更便于扩展者复用已有逻辑,而只是替换某部分实现策略。当然这个分解的粒度需要把握好。
+
+## 微核插件式,平等对待第三方
+
+大凡发展的比较好的框架,都遵守微核的理念。Eclipse 的微核是 OSGi, Spring 的微核是 BeanFactory,Maven 的微核是 Plexus。通常核心是不应该带有功能性的,而是一个生命周期和集成容器,这样各功能可以通过相同的方式交互及扩展,并且任何功能都可以被替换。如果做不到微核,至少要平等对待第三方,即原作者能实现的功能,扩展者应该可以通过扩展的方式全部做到。原作者要把自己也当作扩展者,这样才能保证框架的可持续性及由内向外的稳定性。
+
+## 不要控制外部对象的生命周期
+
+比如上面说的 Action 使用接口和 Renderer 扩展接口。框架如果让使用者或扩展者把 Action 或 Renderer 实现类的类名或类元信息报上来,然后在内部通过反射 newInstance() 创建一个实例,这样框架就控制了 Action 或 Renderer 实现类的生命周期,Action 或 Renderer 的生老病死,框架都自己做了,外部扩展或集成都无能为力。好的办法是让使用者或扩展者把 Action 或 Renderer 实现类的实例报上来,框架只是使用这些实例,这些对象是怎么创建的,怎么销毁的,都和框架无关,框架最多提供工具类辅助管理,而不是绝对控制。
+
+## 可配置一定可编程,并保持友好的 CoC 约定
+
+因为使用环境的不确定因素很多,框架总会有一些配置,一般都会到 classpath 直扫某个指定名称的配置,或者启动时允许指定配置路径。做为一个通用框架,应该做到凡是能配置文件做的一定要能通过编程方式进行,否则当使用者需要将你的框架与另一个框架集成时就会带来很多不必要的麻烦。
+
+另外,尽可能做一个标准约定,如果用户按某种约定做事时,就不需要该配置项。比如:配置模板位置,你可以约定,如果放在 templates 目录下就不用配了,如果你想换个目录,就配置下。
+
+## 区分命令与查询,明确前置条件与后置条件
+
+这个是契约式设计的一部分,尽量遵守有返回值的方法是查询方法,void 返回的方法是命令。查询方法通常是幂等性的,无副作用的,也就是不改变任何状态,调 n 次结果都是一样的,比如 get 某个属性值,或查询一条数据库记录。命令是指有副作用的,也就是会修改状态,比如 set 某个值,或 update 某条数据库记录。如果你的方法即做了修改状态的操作,又做了查询返回,如果可能,将其拆成写读分离的两个方法,比如:User deleteUser(id),删除用户并返回被删除的用户,考虑改为 getUser() 和 void 的 deleteUser()。 另外,每个方法都尽量前置断言传入参数的合法性,后置断言返回结果的合法性,并文档化。
+
+## 增量式扩展,而不要扩充原始核心概念
+
+参见:[谈谈扩充式扩展与增量式扩展](./expansibility.md)
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/principals/introduction.md b/doc-archive/v2.7.3/docs/zh-cn/dev/principals/introduction.md
new file mode 100644
index 0000000..5a9c224
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/principals/introduction.md
@@ -0,0 +1,3 @@
+# 设计原则
+
+本章节的设计原则摘录自梁飞在 javaeye 上发表的系列文章。
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/principals/robustness.md b/doc-archive/v2.7.3/docs/zh-cn/dev/principals/robustness.md
new file mode 100644
index 0000000..249854c
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/principals/robustness.md
@@ -0,0 +1,84 @@
+# 设计实现的健壮性
+
+> http://oldratlee.com/380/tech/java/robustness-of-implement.html
+
+
+Dubbo 作为远程服务暴露、调用和治理的解决方案,是应用运转的经络,其本身实现健壮性的重要程度是不言而喻的。
+
+这里列出一些 Dubbo 用到的原则和方法。
+
+## 日志
+
+日志是发现问题、查看问题一个最常用的手段。日志质量往往被忽视,没有日志使用上的明确约定。重视 Log 的使用,提高 Log 的信息浓度。日志过多、过于混乱,会导致有用的信息被淹没。
+
+要有效利用这个工具要注意:
+
+### 严格约定WARN、ERROR级别记录的内容
+
+* WARN 表示可以恢复的问题,无需人工介入。
+* ERROR 表示需要人工介入问题。
+
+有了这样的约定,监管系统发现日志文件的中出现 ERROR 字串就报警,又尽量减少了发生。过多的报警会让人疲倦,使人对报警失去警惕性,使 ERROR 日志失去意义。再辅以人工定期查看 WARN 级别信息,以评估系统的“亚健康”程度。
+
+### 日志中,尽量多的收集关键信息
+
+哪些是关键信息呢?
+
+* 出问题时的现场信息,即排查问题要用到的信息。如服务调用失败时,要给出使用 Dubbo 的版本、服务提供者的 IP、使用的是哪个注册中心;调用的是哪个服务、哪个方法等等。这些信息如果不给出,那么事后人工收集的,问题过后现场可能已经不能复原,加大排查问题的难度。
+* 如果可能,给出问题的原因和解决方法。这让维护和问题解决变得简单,而不是寻求精通者(往往是实现者)的帮助。
+
+### 同一个或是一类问题不要重复记录多次
+
+同一个或是一类异常日志连续出现几十遍的情况,还是常常能看到的。人眼很容易漏掉淹没在其中不一样的重要日志信息。要尽量避免这种情况。在可以预见会出现的情况,有必要加一些逻辑来避免。
+
+如为一个问题准备一个标志,出问题后打日志后设置标志,避免重复打日志。问题恢复后清除标志。
+
+虽然有点麻烦,但是这样做保证日志信息浓度,让监控更有效。
+
+## 界限设置
+
+资源是有限的,CPU、内存、IO 等等。不要因为外部的请求、数据不受限的而崩溃。
+
+### 线程池(ExectorService)的大小和饱和策略
+
+Server 端用于处理请求的 ExectorService 设置上限。ExecutorService 的任务等待队列使用有限队列,避免资源耗尽。当任务等待队列饱和时,选择一个合适的饱和策略。这样保证平滑劣化。
+
+在 Dubbo 中,饱和策略是丢弃数据,等待结果也只是请求的超时。
+
+达到饱和时,说明已经达到服务提供方的负荷上限,要在饱和策略的操作中日志记录这个问题,以发出监控警报。记得注意不要重复多次记录哦。(注意,缺省的饱和策略不会有这些附加的操作。)根据警报的频率,已经决定扩容调整等等,避免系统问题被忽略。
+
+### 集合容量
+
+如果确保进入集合的元素是可控的且是足够少,则可以放心使用。这是大部分的情况。如果不能保证,则使用有有界的集合。当到达界限时,选择一个合适的丢弃策略。
+
+## 容错-重试-恢复
+
+高可用组件要容忍其依赖组件的失败。
+
+### Dubbo 的服务注册中心
+
+目前服务注册中心使用了数据库来保存服务提供者和消费者的信息。注册中心集群不同注册中心也通过数据库来进行同步数据,以感知其它注册中心上提供者的变化。注册中心会在内存中保存一份提供者和消费者数据,数据库不可用时,注册中心独立对外提供服务以保证正常运转,只是拿不到其它注册中心的数据。当数据库恢复时,重试逻辑会将内存中修改的数据写回数据库,并拿到数据库中新数据。
+
+### 服务的消费者
+
+服务消费者从注册中心拿到提供者列表后,会保存提供者列表到内存和磁盘文件中。这样注册中心宕机后消费者可以正常运转,甚至可以在注册中心宕机过程中重启消费者。消费者启动时,发现注册中心不可用,会读取保存在磁盘文件中提供者列表。重试逻辑保证注册中心恢复后,更新信息。
+
+## 重试延迟策略
+
+上一点的子问题。Dubbo 中碰到有两个相关的场景。
+
+### 数据库上的活锁
+
+注册中心会定时更新数据库一条记录的时间戳,这样集群中其它的注册中心感知它是存活。过期注册中心和它的相关数据 会被清除。数据库正常时,这个机制运行良好。但是数据库负荷高时,其上的每个操作都会很慢。这就出现:
+
+A 注册中心认为 B 过期,删除 B 的数据。 B 发现自己的数据没有了,重新写入自己的数据的反复操作。这些反复的操作又加重了数据库的负荷,恶化问题。
+
+可以使用下面逻辑:
+
+当 B 发现自己数据被删除时(写入失败),选择等待这段时间再重试。重试时间可以选择指数级增长,如第一次等 1 分钟,第二次 10 分钟、第三次 100 分钟。
+
+这样操作减少后,保证数据库可以冷却(Cool Down)下来。
+
+### Client 重连注册中心
+
+当一个注册中心停机时,其它的 Client 会同时接收事件,而去重连另一个注册中心。Client 数量相对比较多,会对注册中心造成冲击。避免方法可以是 Client 重连时随机延时 3 分钟,把重连分散开。
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/release.md b/doc-archive/v2.7.3/docs/zh-cn/dev/release.md
new file mode 100644
index 0000000..b286f74
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/dev/release.md
@@ -0,0 +1,34 @@
+# 版本管理
+
+**新功能的开发** 和 **稳定性的提高** 对产品都很重要。但是添加新功能会影响稳定性,Dubbo 使用如下的版本开发模式来保障两者。
+
+## 2 个版本并行开发
+
+* BugFix 版本:低版本,比如 `2.4.x`。是 GA 版本,线上使用的版本,只会 BugFix,升级第三位版本号。
+* 新功能版本:高版本,比如 `2.5.x`。加新功能的版本,会给对新功能有需求的应用试用。
+
+`2.5.x` 的新功能基本稳定后,进入 `2.5.x` 试用阶段。找足够多的应用试用 `2.5.x` 版本。
+
+在 `2.5.x` 够稳定后:
+
+* `2.5.x` 成为 GA 版本,只 BugFix,推广使用此版本。如果版本可用,可以推进应用在期望的时间点内升级到 GA 版本。
+* `2.4.x` 不再开发,应用碰到 Bug 让直接升级。(这个称为“夕阳条款”)
+* 从 `2.5.x` 拉成分支 `2.6.0`,作为新功能开发版本。
+
+## 优势
+
+* 保证 GA 版本是稳定的!因为:
+ * 只会作 BugFix
+ * 成为 GA 版本前有试用阶段
+* 新功能可以在高版本中快速响应,并让应用能试用新功能。
+* 不会版本过多,导致开发和维护成本剧增
+
+## 用户要配合的职责
+
+由于开发只会 BugFix GA 版本,所以用户需要积极跟进升级到 GA 版本,以 Fix 发现的问题。
+
+定期升级版本给用户带来了不安。这是一个假命题,说明如下:
+
+* GA 经过一个试用阶段保持稳定。
+* GA 版本有 Bug 会火速 Fix
+* 相对出问题才升级到 GA 版本(可能跨了多个版本)定期升级平摊风险(类似小步快跑)。经历过周期长的大项目的同学会有这样的经历,三方库版本长时间不升级,结果出了问题不得不升级到新版本(跨了多个版本)风险巨大。
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/close-expand.jpg b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/close-expand.jpg
new file mode 100644
index 0000000..58a72ce
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/close-expand.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/configuration-override.png b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/configuration-override.png
new file mode 100644
index 0000000..39afaad
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/configuration-override.png differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/ddd.jpg b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/ddd.jpg
new file mode 100644
index 0000000..f32972a
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/ddd.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/design-step1.png b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/design-step1.png
new file mode 100644
index 0000000..cef59da
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/design-step1.png differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/design-step2.png b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/design-step2.png
new file mode 100644
index 0000000..f1d9046
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/design-step2.png differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/design-step3.png b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/design-step3.png
new file mode 100644
index 0000000..bee3f5f
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/design-step3.png differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/design-step4.png b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/design-step4.png
new file mode 100644
index 0000000..66ca86f
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/design-step4.png differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo-export.jpg b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo-export.jpg
new file mode 100644
index 0000000..b4d83a3
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo-export.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo-extension.jpg b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo-extension.jpg
new file mode 100644
index 0000000..5ebe3c9
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo-extension.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo-framework.jpg b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo-framework.jpg
new file mode 100644
index 0000000..005408a
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo-framework.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo-modules.jpg b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo-modules.jpg
new file mode 100644
index 0000000..946cb09
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo-modules.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo-protocol.jpg b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo-protocol.jpg
new file mode 100644
index 0000000..181f60c
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo-protocol.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo-refer.jpg b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo-refer.jpg
new file mode 100644
index 0000000..6154b7f
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo-refer.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo-relation.jpg b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo-relation.jpg
new file mode 100644
index 0000000..edd9c2a
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo-relation.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo_protocol_header.png b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo_protocol_header.png
new file mode 100644
index 0000000..c1daac3
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo_protocol_header.png differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo_rpc_export.jpg b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo_rpc_export.jpg
new file mode 100644
index 0000000..0800c8b
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo_rpc_export.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo_rpc_invoke.jpg b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo_rpc_invoke.jpg
new file mode 100644
index 0000000..fda28cf
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo_rpc_invoke.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo_rpc_refer.jpg b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo_rpc_refer.jpg
new file mode 100644
index 0000000..a70d08b
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/dubbo_rpc_refer.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/event-listener.jpg b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/event-listener.jpg
new file mode 100644
index 0000000..ea67d8a
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/event-listener.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/filter-chain.jpg b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/filter-chain.jpg
new file mode 100644
index 0000000..1e0e8b4
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/filter-chain.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/mix-api-spi.jpg b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/mix-api-spi.jpg
new file mode 100644
index 0000000..60daa63
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/mix-api-spi.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/open-expand.jpg b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/open-expand.jpg
new file mode 100644
index 0000000..c686be3
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/open-expand.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/seperate-api-spi.jpg b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/seperate-api-spi.jpg
new file mode 100644
index 0000000..ec6823c
Binary files /dev/null and b/doc-archive/v2.7.3/docs/zh-cn/dev/sources/images/seperate-api-spi.jpg differ
diff --git a/doc-archive/v2.7.3/docs/zh-cn/developers/committer-guide/apache-dubbo-page_dev.md b/doc-archive/v2.7.3/docs/zh-cn/developers/committer-guide/apache-dubbo-page_dev.md
new file mode 100644
index 0000000..8e56da0
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/developers/committer-guide/apache-dubbo-page_dev.md
@@ -0,0 +1,28 @@
+# Apache官方Dubbo主页的维护
+
+Apache有一个官方的网站,用来维护所有的孵化项目的信息。每一个孵化项目在这个网站下都有一个信息页。
+Dubbo的信息页地址是[https://incubator.apache.org/projects/dubbo.html](https://incubator.apache.org/projects/dubbo.html)。
+
+当项目发生比较大的变化,比如新的committer的加入,新的PMC的当选,或是新版本的Release等,都需要将这些更新信息维护到这个页面。
+这个官方网站的项目地址是[https://svn.apache.org/repos/asf/incubator/public/trunk](https://svn.apache.org/repos/asf/incubator/public/trunk)。
+
+维护这个页面的方法如下:
+
+1.安装SVN。若是Mac OS X系统或是Linux系统,则自带了SVN。若是Windows系统,则请首先自行安装SVN。
+
+2.用SVN将这个[项目](https://svn.apache.org/repos/asf/incubator/public/trunk)checkout下来 。
+
+3.修改content/projects/dubbo.xml文件,并保存。
+
+4.安装ANT。执行trunk目录下的build.sh或者build.bat脚本构建项目。
+
+5.构建完成后,可以用浏览器打开target/site/projects/dubbo.html文件,预览修改是否生效。
+
+6.用SVN的commit命令将dubbo.xml文件提交到服务器,并且不要提交dubbo.html文件(因为服务器端会定时自动构建)。
+此过程会要求输入Apache id和密码。
+
+参考:
+
+1.http://incubator.apache.org/guides/website.html
+
+2.https://svn.apache.org/repos/asf/incubator/public/trunk/README.txt
diff --git a/doc-archive/v2.7.3/docs/zh-cn/developers/committer-guide/label-an-issue-guide_dev.md b/doc-archive/v2.7.3/docs/zh-cn/developers/committer-guide/label-an-issue-guide_dev.md
new file mode 100644
index 0000000..55bee74
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/developers/committer-guide/label-an-issue-guide_dev.md
@@ -0,0 +1,27 @@
+# 给问题打标签
+
+如果您正在处理一个问题,请记得**给这个问题标记一个或者多个您认为有意义的标签**。有了标签,其他开发人员就会很轻松地识别出问题,以便对其进行分类并跟踪进度。
+
+对于需要编码和发版修复的issues和pull requests,需要您**将其标记为[milestone](https://github.com/apache/incubator*dubbo/milestones)**。
+
+一些常用的标签:
+
+* 请求帮助
+ * help wanted
+ * good first issue
+* 优先级
+ * priority/blocker
+ * priority/high
+ * priority/low
+ * priority/normal
+* 状态
+ * status/need-triage
+ * status/DO-NOT-MERGE
+ * status/READY-TO-MERGE
+ * status/invalid
+ * status/wontfix
+* 类型
+ * type/bug
+ * type/documentation
+ * type/enhancement
+ * type/feature
diff --git a/doc-archive/v2.7.3/docs/zh-cn/developers/committer-guide/new-committer-guide_dev.md b/doc-archive/v2.7.3/docs/zh-cn/developers/committer-guide/new-committer-guide_dev.md
new file mode 100644
index 0000000..c896f3d
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/developers/committer-guide/new-committer-guide_dev.md
@@ -0,0 +1,73 @@
+# Apache 提交者注册流程
+
+## 一、Apache 提交者的产生
+### 项目孵化初始化提交者
+ 项目孵化阶段,在孵化项目提案中,会有初始化提交者列表这一选项。确认你是初始化提交者的一员。项目在 apache 孵化器社区投票通过后,提交者可以开始准备注册账户了。可以参看[孵化器 wiki](https://wiki.apache.org/incubator/)
+### 活跃的贡献者被选举为提交者
+ 在后期的开发过程中,活跃的贡献者可以被选举为提交者。见[如何成为 committer](https://www.apache.org/dev/new-committers-guide.html#becoming-a-committer)
+
+## 二、个人开发者提交 ICLA
+
+### 1、选择 apache id
+ 在[ apache 提交者列表页](http://people.apache.org/committer-index.html)查看已经注册过的 apache id,
+### 2、个人提交者授权协议(ICLA):
+ 下载[ ICLA 模板](https://www.apache.org/licenses/icla.pdf),查找可用的 id。将 icla.pdf 个人信息填写正确后打印,签名、扫描、并当做附件发送邮件给秘书 secretary@apache.org,秘书会帮忙创建 apache 用户 id。同时会创建一个 your_id@apache.org 的邮箱,可以在[ apache 提交者列表页](http://people.apache.org/committer-index.html)查看查找用户是否已经创建。
+### 3、导师帮助提交用户id创建请求
+ 导师将帮助提交 apache 账户创建请求给 root 邮件组,会有人帮助建立 id。一般需要2天时间账户会建立,请等待并在[ apache 提交者列表页](http://people.apache.org/committer-index.html)查看查找用户是否已经创建。
+
+## 三、加入apache开发者组
+ * 1、登陆 [Apache 账户工具](https://id.apache.org/),在登陆页面点击"忘记密码"设置始化密码,会有一封密码重置邮件发送到 forward 邮箱(在孵化项目提案中提交的开发者邮件)
+ * 2、关于 apache 邮箱:apache.org 邮箱并没有自己的邮件内容存储服务器。它需要借用其他邮件提供商的邮件内容存储、分发功能。在很多投票环节是建议使用 apache 邮箱的。
+ 这里就有一个问题,怎么在其它邮箱里面配置 apache.org 邮箱转发功能:
+ 1)收件箱:收取发送到 apache.org 的邮件。这个在第一步配置好 Apache 账户工具的 forward 邮箱就可以用 forward 邮箱收取邮件了
+ 2)发件箱:将发出的邮件显示发件邮箱为 apache.org 邮箱。请参考:[设置 apache 邮箱指南](https://reference.apache.org/committer/email)和[ gmail 邮箱设置方式](http://gmailblog.blogspot.com/2009/07/send-mail-from-another-address-without.html)。 其他邮箱服务的设置方式不方便找到,gmail 的最方便,建议换成 gmail 邮箱(不是广告)。
+ * 3、修改编辑页面的 homepage url,[apache 提交者列表页](http://people.apache.org/committer-index.html)中你的账户能加主页链接。
+ * 4、修改编辑页面的 github 账户(username),提交确认后两个小时内会有邮件邀请你加入 github.com/apache-committers 组。这期间可以阅读[ ASF 工作方式](http://www.apache.org/foundation/how-it-works.html#developers)以对 ASF 开发做一些基本了解。
+## 四、提交者获得对项目的写权限
+
+[GitBox 账户链接工具](https://gitbox.apache.org/setup/)的操作
+
+### 1、Apache账户授权
+ 按照提示授权对 Apache 账户的 OAuth 协议登入
+### 2、Github账户授权
+ 按照提示授权对 github 账户的 OAuth 协议登入
+### 3、在 github.com 设置 github 账户两因素授权(2FA)
+ 按照[授权 GitHub 2FA wiki](https://help.github.com/articles/configuring-two-factor-authentication-via-a-totp-mobile-app/) 操作如下:
+* 1)、在手机安装 “google 身份验证器” app
+* 2)、按照[授权 GitHub 2FA wiki](https://help.github.com/articles/configuring-two-factor-authentication-via-a-totp-mobile-app/) 一步一步操作。
+
+ 在[两因素授权验证](https://github.com/settings/two_factor_authentication/verify)界面,不建议选择用手机扫描二维码,因为有些手机会扫描不出来。
+ 请打开手机 “google 身份验证器” app,点“+”选择“输入提供的秘钥”: 在“账户名” input 框写入 github 账户。在“您的秘钥” input 框写入:打开的网页中 "enter this text code" 链接里面的文本。在 app 中点击"添加" 后,将为此账户生成6位数字动态。将此6位数字写入网页中的文本框,然后点 “Enable”。这样 2FA 就设置成功了。
+
+* 3)、退出并重新登陆 github,输入用户名、密码后会多一步动态密码的填写,该动态密码就是 google 身份验证器上面的动态密码
+
+* 4)、大概需要半个小时,会有邮件通知你已经加入了 xx project-committers 开发者组。你也可以进入 [apache teams](https://github.com/orgs/apache/teams) 页面查看。
+
+* 5)、2FA 提交后,你已经 clone 的项目会有权限校验问题,解决方法为下面二选一:
+ * a. 申请 Access Token:
+ 在 github 上生成 access token 后,指令行需要密码的地方就粘贴token。
+ 参考官网[帮助链接一](https://help.github.com/articles/https-cloning-errors/#provide-access-token-if-2fa-enabled)和[帮助链接二](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)
+ * b. 改用 ssh:
+ 在命令行执行 ssh-keygen 命令, 然后把pub文件中的内容粘贴到 github 上
+
+* 注意:一定要保证 github 的 2FA 为 "enable" 状态。当你将 2FA 设置为 "off" 时候,将会被对应的 apache committer 写权限组除名,直到你再次设置成功为止。
+
+## 五、其他
+
+### The Apache Way
+详情请参考 [wiki](http://apache.org/foundation/governance/)
+
+社区重于代码,如果某问题或者方案没有在社区(邮件列表)讨论过,就当没有发生过
+
+### 添加你的名字
+
+请访问孵化器[主页](https://incubator.apache.org/projects/dubbo.html)将你的名字添加到上面. 具体可以参考这个[文档](http://dubbo.apache.org/zh-cn/docs/developers/committer-guide/apache-dubbo-page_dev.html).
+
+请访问Dubbo[官方网站](http://dubbo.apache.org/zh-cn/docs/developers/developers_dev.html)将你的名字添加到上面.
+
+### 小福利
+
+Jetbrains 给 apache 提交者一个小福利,就是可以免费使用 idea 的全产品系列。具体注册地址为:https://www.jetbrains.com/shop/eform/apache?product=ALL
+
+### 相关 wiki
+https://www.apache.org/dev/new-committers-guide.html
diff --git a/doc-archive/v2.7.3/docs/zh-cn/developers/committer-guide/release-guide_dev.md b/doc-archive/v2.7.3/docs/zh-cn/developers/committer-guide/release-guide_dev.md
new file mode 100644
index 0000000..e128a15
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/developers/committer-guide/release-guide_dev.md
@@ -0,0 +1,464 @@
+---
+title: 如何准备Apache Release
+keywords: Dubbo, Apache, Release
+---
+
+# 如何准备Apache Release
+
+## 理解Apache发布的内容和流程
+
+总的来说,Source Release是Apache关注的重点,也是发布的必须内容;而Binary Release是可选项,Dubbo可以选择是否发布二进制包到Apache仓库或者发布到Maven中央仓库。
+
+请参考以下链接,找到更多关于ASF的发布指南:
+
+- [Apache Release Guide](http://www.apache.org/dev/release-publishing)
+- [Apache Release Policy](http://www.apache.org/dev/release.html)
+- [Maven Release Info](http://www.apache.org/dev/publishing-maven-artifacts.html)
+
+## 本地构建环境准备
+
+主要包括签名工具、Maven仓库认证相关准备
+
+### 安装GPG
+
+详细文档请参见[这里](https://www.gnupg.org/download/index.html), Mac OS下配置如下
+
+```sh
+$ brew install gpg
+$ gpg --version #检查版本,应该为2.x
+```
+
+### 用gpg生成key
+
+根据提示,生成key
+
+ ```shell
+ $ gpg --full-gen-key
+ gpg (GnuPG) 2.0.12; Copyright (C) 2009 Free Software Foundation, Inc.
+ This is free software: you are free to change and redistribute it.
+ There is NO WARRANTY, to the extent permitted by law.
+
+ Please select what kind of key you want:
+ (1) RSA and RSA (default)
+ (2) DSA and Elgamal
+ (3) DSA (sign only)
+ (4) RSA (sign only)
+ Your selection? 1
+ RSA keys may be between 1024 and 4096 bits long.
+ What keysize do you want? (2048) 4096
+ Requested keysize is 4096 bits
+ Please specify how long the key should be valid.
+ 0 = key does not expire
+ <n> = key expires in n days
+ <n>w = key expires in n weeks
+ <n>m = key expires in n months
+ <n>y = key expires in n years
+ Key is valid for? (0)
+ Key does not expire at all
+ Is this correct? (y/N) y
+
+ GnuPG needs to construct a user ID to identify your key.
+
+ Real name: Robert Burrell Donkin
+ Email address: rdonkin@apache.org
+ Comment: CODE SIGNING KEY
+ You selected this USER-ID:
+ "Robert Burrell Donkin (CODE SIGNING KEY) <rd...@apache.org>"
+
+ Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
+ You need a Passphrase to protect your secret key. # 填入密码,以后打包过程中会经常用到
+ ```
+
+### 查看key id
+
+```sh
+$ gpg --list-keys
+pub rsa4096/28681CB1 2018-04-26 # 28681CB1就是key id
+uid [ultimate] liujun (apache-dubbo) <li...@apache.org>
+sub rsa4096/D3D6984B 2018-04-26
+
+# 通过key id发送public key到keyserver
+$ gpg --keyserver pgpkeys.mit.edu --send-key 28681CB1
+# 其中,pgpkeys.mit.edu为随意挑选的keyserver,keyserver列表为:https://sks-keyservers.net/status/,为相互之间是自动同步的,选任意一个都可以。
+```
+如果有多个public key,设置默认key。修改`~/.gnupg/gpg.conf`
+
+```sh
+# If you have more than 1 secret key in your keyring, you may want to
+# uncomment the following option and set your preferred keyid.
+default-key 28681CB1
+```
+如果有多个public key, 也可以删除无用的key:
+
+```sh
+### 先删除私钥,再删除公钥
+$ gpg --yes --delete-secret-keys shenglicao2@gmail.com ###老的私钥,指明邮箱即可
+$ gpg --delete-keys 1808C6444C781C0AEA0AAD4C4D6A8007D20DB8A4
+```
+
+> PS: 最新版本经过实测,本地没有gpg.conf这个文件,因此如果在执行过程中遇到签名失败,可以参考这个文章:https://blog.csdn.net/wenbo20182/article/details/72850810 或 https://d.sb/2016/11/gpg-inappropriate-ioctl-for-device-errors
+
+### 设置Apache中央仓库
+
+Dubbo项目的父pom为Apache pom(2.7.0以上版本需要,2.6.x发布版本不需要此操作)
+
+```xml
+<parent>
+<groupId>org.apache</groupId>
+<artifactId>apache</artifactId>
+<version>19</version>
+</parent>
+```
+ 添加以下内容到.m2/settings.xml
+ 所有密码请使用[maven-encryption-plugin](http://maven.apache.org/guides/mini/guide-encryption.html)加密后再填入
+```xml
+<settings>
+...
+ <servers>
+ <!-- To publish a snapshot of some part of Maven -->
+ <server>
+ <id>apache.snapshots.https</id>
+ <username> <!-- YOUR APACHE LDAP USERNAME --> </username>
+ <password> <!-- YOUR APACHE LDAP PASSWORD (encrypted) --> </password>
+ </server>
+ <!-- To stage a release of some part of Maven -->
+ <server>
+ <id>apache.releases.https</id>
+ <username> <!-- YOUR APACHE LDAP USERNAME --> </username>
+ <password> <!-- YOUR APACHE LDAP PASSWORD (encrypted) --> </password>
+ </server>
+ ...
+ <!-- gpg passphrase used when generate key -->
+ <server>
+ <id>gpg.passphrase</id>
+ <passphrase><!-- yourKeyPassword --></passphrase>
+ </server>
+ </servers>
+</settings>
+```
+
+
+## 打包&上传
+
+### 准备分支
+
+从主干分支拉取新分支作为发布分支,如现在要发布$`{release_version}`版本,则从2.6.x拉出新分支`${release_version}-release`,此后`${release_version}` Release Candidates涉及的修改及打标签等都在`${release_version}-release`分支进行,最终发布完成后合入主干分支。
+
+### 编译打包
+
+首先,在`${release_version}-release`分支验证maven组件打包、source源码打包、签名等是否都正常工作。**2.6.x记得要使用1.6进行编译打包**
+
+```shell
+$ mvn clean install -Prelease
+$ mvn deploy
+```
+
+上述命令将snapshot包推送到maven中央仓库
+
+### ~~用maven-release-plugin发布~~ (`废弃`,参考后一步)
+
+~~先用dryRun验证是否ok~~
+
+```shell
+$ mvn release:prepare -Prelease -Darguments="-DskipTests" -DautoVersionSubmodules=true -Dusername=YOUR GITHUB ID-DdryRun=true
+```
+
+~~验证通过后,执行release:prepare~~
+
+```shell
+$ mvn release:clean
+$ mvn release:prepare -Prelease -Darguments="-DskipTests" -DautoVersionSubmodules=true -Dusername=YOUR GITHUB ID -DpushChanges=false
+```
+
+> 执行release插件时,如果指定了`-DpushChanges=true`, 插件会自动提交到远端的GitHub仓库中,此时就需要输入GitHub的密码,注意不是输入web页面的登录密码,而是一个`Personal access tokens`,获取方式详见[这里](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)
+
+> 这里有一点要注意的是tag, 在执行过程中,需要选择发布的artifactId, 下一个版本artifactId以及发布版本的tag, tag默认的是dubbo-parent-xxxx,需要改成dubbo-xxxx
+
+执行完上述步骤后,你会发现:
+1. `source-release.zip` 和 `bin-release.zip`包已经生成在`dubbo-distribution`目录下,请解压并检查文件是否完整
+2. 本地已经打出相应的tag,同时新增一个commit,名叫`[maven-release-plugin] prepare release dubbo-x.x.x`
+3. 分支版本自动升级为`${release_version+1}-SNAPSHOT`,同时新增一个commit,名叫`[[maven-release-plugin] prepare for next development iteration`
+
+> 如果指定了`-DpushChanges=true`, 则本地提交会自动推送到远端的GitHub仓库。根据经验,建议不要指定为true,请设置为false,待本地检查通过之后再手动提交
+
+~~执行release:perform,做staging发布~~
+
+```shell
+$ mvn -Prelease release:perform -Darguments="-DskipTests" -DautoVersionSubmodules=true -Dusername=YOUR GITHUB ID
+```
+
+此时插件会自动下载远端的tag对应的源码,编译后,将所有Artifacts发布到配置的远程[maven仓库](http://repository.apache.org),处于staging状态。
+
+### 使用mvn deploy进行deploy
+
+> 要求:maven 3.5+
+
+修改pom文件中的版本号,从2.7.x-SNAPSHOT改为2.7.x, 目前有3个地方需要修改。建议全文搜索。
+
+```shell
+$ mvn clean install -Prelease
+$ mvn deploy -Prelease -DskipTests
+```
+
+所有被deploy到远程[maven仓库](http://repository.apache.org)的Artifacts都会处于staging状态
+
+#### 注意点
+
+- 在deploy执行过程中,有可能因为网络等原因被中断,如果是这样,可以重新开始执行。
+- deploy执行到maven仓库的时候,请确认下包的总量是否正确。多次出现了包丢失的情况,特别是dubbo-parent包。
+
+
+## 准备Apache发布
+
+1. 准备svn本机环境(Apache使用svn托管项目的发布内容)
+
+2. 将dubbo checkout到本地目录
+
+ ```shell
+ $ svn checkout https://dist.apache.org/repos/dist/dev/dubbo
+ # 假定本地目录为 ~/apache/dubbo
+ ```
+
+3. 当前发布版本为${release_version},新建目录
+
+ ```shell
+ $ cd ~/apache/dubbo # dubbo svn根目录
+ $ mkdir ${release_version}
+ ```
+
+4. 添加public key到[KEYS](https://dist.apache.org/repos/dist/dev/dubbo/KEYS)文件并提交到SVN仓库(第一次做发布的人需要做这个操作,具体操作参考KEYS文件里的说明)。KEYS主要是让参与投票的人在本地导入,用来校验sign的正确性
+
+ ```sh
+ $ (gpg --list-sigs <your name> && gpg --armor --export <your name>) >> KEYS
+ ```
+
+5. 拷贝`distribution/target`下的source相关的包到svn本地仓库`dubbo/${release_version}`
+
+6. 生成sha512签名
+
+ 针对`source-release.zip`
+
+ ```shell
+ $ shasum -a 512 apache-dubbo-${release_version}-source-release.zip >> apache-dubbo-${release_version}-source-release.zip.sha512
+ ```
+
+ 针对`bin-release.zip`,需要增加`-b`参数,表明是一个二进制文件
+
+ ```shell
+ $ shasum -b -a 512 apache-dubbo-${release_version}-bin-release.zip >> apache-dubbo-${release_version}-bin-release.zip.sha512
+ ```
+
+
+7. 如果有binary release要同时发布
+
+ 在`distribution/target`目录下,拷贝`bin-release.zip`以及`bin-release.zip.asc`到svn本地仓库`dubbo/${release_version}`,参考第6步,生成sha512签名。
+
+8. 提交到Apache svn
+
+ ```shell
+ $ svn status
+ $ svn commit -m 'prepare for ${release_version} RC1'
+ ```
+
+9. 关闭Maven的staging仓库
+
+ 此步骤为发布2.7.0及以上版本必须要的步骤。在此之前请先确保所有的artifact都是ok的。登录http://repository.apache.org,点击左侧的`Staging repositories`,然后搜索Dubbo关键字,会出现一系列的仓库,选择你最近上传的仓库,然后点击上方的Close按钮,这个过程会进行一系列检查,检查通过以后,在下方的Summary标签页上出现一个连接,请保存好这个链接,需要放在接下来的投票邮件当中。链接应该是类似这样的: https://repository.apache.org/content/repositories/orgapachedubbo-1015
+
+ > 请注意点击Close可能会出现失败,通常是网络原因,只要重试几次就可以了。可以点击Summary旁边的Activity标签来确认。
+
+## 验证Release Candidates
+
+详细的检查列表请参考官方的[check list](https://wiki.apache.org/incubator/IncubatorReleaseChecklist)
+
+首先,从一下地址下载要发布的Release Candidate到本地环境:
+
+<pre>
+https://dist.apache.org/repos/dist/dev/dubbo/${release_version}/
+</pre>
+
+然后,开始验证环节,验证包含但不限于以下内容和形式
+
+### 检查签名和hash等信息
+
+#### 检查sha512哈希
+
+```sh
+$ shasum -c apache-dubbo-${release_version}-source-release.zip.sha512
+$ shasum -c apache-dubbo-${release_version}-bin-release.zip.sha512
+```
+
+#### 检查gpg签名
+
+如果是第一次检查,需要首先导入公钥。
+
+```sh
+ $ curl https://dist.apache.org/repos/dist/dev/dubbo/KEYS >> KEYS # download public keys to local directory
+ $ gpg --import KEYS # import keys
+ $ gpg —edit-key liujun
+ > trust # type trust command
+ ```
+然后使用如下命令检查签名
+
+ ```sh
+gpg --verify apache-dubbo-2.6.3-source-release.zip.asc apache-dubbo-2.6.3-source-release.zip
+gpg --verify apache-dubbo-2.6.3-bin-release.zip.asc apache-dubbo-2.6.3-bin-release.zip
+ ```
+
+
+### 检查源码包的文件内容
+
+解压缩`apache-dubbo-${release_version}-source-release.zip`,进行如下检查:
+
+- DISCLAIMER exists
+- LICENSE and NOTICE exists and contents are good
+- All files and no binary files exist
+- All files has standard ASF License header
+- Can compile from source
+- All unit tests can pass
+ ```sh
+ mvn clean test # This will run all unit tests
+ # you can also open rat and style plugin to check if every file meets requirements.
+ mvn clean test -Drat.skip=false -Dcheckstyle.skip=false
+ ```
+- Release candidates match with corresponding tags, you can find tag link and hash in vote email.
+ - check the version number in pom.xml are the same
+ - check there are no extra files or directories in the source package, for example, no empty directories or useless log files,这里需要注意换行符是否一致
+ `diff -r a rc_dir tag_dir`
+ - check the top n tag commits, dive into the related files and check if the source package has the same changes
+
+### 检查三方依赖的合规性
+
+按照Apache基金会合规性规定,源码或者是二进制分发包中均不能包含Category X的依赖,其中就常见的是包含了GPL/LGPL的依赖,即使是传递依赖也不行。因此在发版的时候需要通过以下的命令进行检查:
+
+```sh
+mvn license:add-third-party -Dlicense.useMissingFile
+find . -name THIRD-PARTY.txt | xargs grep -E 'GPL|General Public License' | grep -v Apache | grep -v MIT | grep -v CDDL
+```
+
+如果一个依赖提供了双协议或多重协议,可以选择与Apache最兼容的一个协议。
+
+### 检查二进制包的文件内容
+
+解压缩`apache-dubbo-${release_version}-bin-release.zip`,进行如下检查:
+
+* Check signatures are good
+* LICENSE and NOTICE exists and contents are good
+
+注意,如果二进制包里面引入了第三方依赖,则需要更新LICENSE,加入第三方依赖的LICENSE,如果第三方依赖的LICENSE是Apache 2.0,并且对应的项目中包含了NOTICE,还需要更新NOTICE文件
+
+## 进入投票
+
+dubbo毕业之后,投票分只需要一次:
+
+1. Dubbo社区投票,发起投票邮件到dev@dubbo.apache.org。在社区开发者Review,经过至少72小时并统计到3个同意发版的binding票后(只有PMC的票才是binding),即可进入下一阶段的投票。
+
+Dubbo社区投票邮件模板:
+
+```text
+Hello Dubbo Community,
+
+This is a call for vote to release Apache Dubbo version 2.7.2.
+
+The release candidates:
+https://dist.apache.org/repos/dist/dev/dubbo/2.7.2/
+
+The staging repo:
+https://repository.apache.org/content/repositories/orgapachedubbo-1005
+
+Git tag for the release:
+https://github.com/apache/dubbo/tree/dubbo-2.7.2
+
+Hash for the release tag:
+afab04c53edab38d52275d2a198ea1aff7a4f41e
+
+Release Notes:
+https://github.com/apache/dubbo/releases/tag/untagged-4775c0a22c60fca55118
+
+The artifacts have been signed with Key : 28681CB1, which can be found in the keys file:
+https://dist.apache.org/repos/dist/dev/dubbo/KEYS
+
+The vote will be open for at least 72 hours or until necessary number of votes are reached.
+
+Please vote accordingly:
+
+[ ] +1 approve
+[ ] +0 no opinion
+[ ] -1 disapprove with the reason
+
+Thanks,
+The Apache Dubbo Team
+```
+
+
+宣布投票结果模板:
+```text
+We’ve received 3 +1 binding votes and one +1 non-binding vote:
+
++1 binding, Ian Luo
++1 binding, Huxing Zhang
++1 binding, Jun Liu
+
++1 non-binding, Jerrick
+
+I will start to release today.
+
+Best regards,
+The Apache Dubbo Team
+```
+
+## 正式发布
+
+1. 将[dev](https://dist.apache.org/repos/dist/dev/dubbo)目录下的发布包添加到[release](https://dist.apache.org/repos/dist/release/dubbo)目录下,KEYS有更新的,也需要同步更新。
+2. 删除[dev](https://dist.apache.org/repos/dist/dev/dubbo)目录下的发布包
+3. 删除[release](https://dist.apache.org/repos/dist/release/dubbo)目录下上一个版本的发布包,这些包会被自动保存在[这里](https://archive.apache.org/dist/dubbo)
+4. 发布GitHub上的[release notes](https://github.com/apache/dubbo/releases)
+5. 修改GitHub的Readme文件,将版本号更新到最新发布的版本
+6. 在官网下载[页面](http://dubbo.apache.org/en-us/blog/download.html)上添加最新版本的下载链接。最新的下载链接应该类似[这样](https://www.apache.org/dyn/closer.cgi?path=dubbo/$VERSION/apache-dubbo-$VERSION-source-release.zip). 同时更新以前版本的下载链接,改为类似[这样](https://archive.apache.org/dist/dubbo/$VERSION/apache-dubbo-$VERSION-bin-release.zip). 具体可以参考过往的[下载链接](https://github.com/apache/dubbo-website/blob/asf-site/blog/en-us/download.md)
+7. 合并`${release-version}-release`分支到对应的主干分支, 然后删除相应的release分支,例如: `git push origin --delete 2.7.0-release`
+8. 发邮件到 `dev@dubbo.apache.org`
+宣布release邮件模板:
+
+```text
+Hello Community,
+
+The Apache Dubbo team is pleased to announce that the
+2.6.6 has just been released.
+
+Apache Dubbo™ is a high-performance, java based, open source
+RPC framework. Dubbo offers three key functionalities, which include
+interface based remote call, fault tolerance & load balancing, and
+automatic service registration & discovery.
+
+Both the source release[1] and the maven binary release[2] are available
+now, you can also find the detailed release notes in here[3].
+
+
+If you have any usage questions, or have problems when upgrading or find
+any problems about enhancements included in this release, please don’t
+hesitate to let us know by sending feedback to this mailing list or filing
+an issue on GitHub[4].
+
+
+[1] http://dubbo.apache.org/en-us/blog/download.html
+[2] http://central.maven.org/maven2/com/alibaba/dubbo
+[3] https://github.com/apache/dubbo/releases
+[4] https://github.com/apache/dubbo/issues
+
+```
+
+
+## 完成Maven Convenient Binary发布(可选)
+
+**repository.apache.org** nexus仓库的权限已经申请,参见[jira](https://issues.apache.org/jira/browse/INFRA-16451)
+
+发布jar包到maven仓库,首先访问[repository.apache.org](https://repository.apache.org), 选择`staging repository`, 点击`release`按钮。等待一段时间之后,在[这里](https://repository.apache.org/content/repositories/releases/org/apache/dubbo/)确认完整性和正确性. 发布到Maven中央仓库则还需要等待一段时间。可以在[这里](https://repo.maven.apache.org/maven2/org/apache/dubbo)进行确认。
+
+## FAQ
+
+#### gpg: signing failed: Inappropriate ioctl for device
+
+If you've encountered this error, try the following commands:
+
+```
+export GPG_TTY=$(tty)
+```
diff --git a/doc-archive/v2.7.3/docs/zh-cn/developers/committer-guide/website-guide_dev.md b/doc-archive/v2.7.3/docs/zh-cn/developers/committer-guide/website-guide_dev.md
new file mode 100644
index 0000000..73eb914
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/developers/committer-guide/website-guide_dev.md
@@ -0,0 +1,5 @@
+# 网站向导
+
+1. Apache Dubbo 的网站仓库是 https://github.com/apache/dubbo-website
+2. 网站构建完毕后,它会被自动发布到 dubbo.apache.org,您也可以通过 https://selfserve.apache.org 手动触发(需要使用 Apache 账号登陆)
+
diff --git a/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/become-a-committer_dev.md b/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/become-a-committer_dev.md
new file mode 100644
index 0000000..4d03053
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/become-a-committer_dev.md
@@ -0,0 +1,3 @@
+# 如何成为Dubbo committer
+
+本文描述如何成为Dubbo committer
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/cla-signing-guide_dev.md b/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/cla-signing-guide_dev.md
new file mode 100644
index 0000000..6ae7a04
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/cla-signing-guide_dev.md
@@ -0,0 +1,24 @@
+# CLA签署向导
+
+以下情况,需要您签署Apache ICLA:
+
+* 在Dubbo被捐赠给Apache之前,您已经为Dubbo作出了很多贡献,并且您以前没有签署过Alibaba-CLA。
+* 您已经为Dubbo作出了很多贡献,并且您被邀请成为Dubbo提交者,且之前没有签署过Alibaba-CLA或者Apache ICLA。
+
+### 步骤
+
+* 下载这篇[pdf文档](https://www.apache.org/licenses/icla.pdf)
+* 编辑该文档,在必要的空格处填上适当的内容
+* 打印
+* 在打印好的文件上签字
+* 扫描
+* 发送一封邮件到secretary@apache.org,并抄送给private@dubbo.apache.org:
+ * 邮件标题为“ICLA submission”
+ * 请在邮件正文附上您的github账号链接
+ * 请记得将您的ICLA文档放入邮件的附件里
+
+### 空格填写必要说明
+
+* Mailing address:首选英文格式的公司地址
+* preferred apache id(s):如果您被邀请成为一名提交者,那么需要您填写一个apache账号,否则,可以不填
+* notify project:Dubbo(意思就是Dubbo就是通知您签署ICLA的项目)
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/dubbo-extension-guide_dev.md b/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/dubbo-extension-guide_dev.md
new file mode 100644
index 0000000..ad2f2d9
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/dubbo-extension-guide_dev.md
@@ -0,0 +1,47 @@
+# Dubbo Extension向导
+
+Dubbo使用微内核+插件的设计模式。内核只负责组装插件,Dubbo的功能都是由扩展点(插件)实现,这就意味着Dubbo的所有功能都可以被用户定制的扩展所替代。
+
+### Dubbo生态系统
+
+我们建议您将扩展加入到Dubbo生态系统。使用这种模式,可以使Dubbo的核心仓库更干净,并且可以减少维护工作。更少的代码也可以提高核心仓库的构建速度。
+
+### 依赖
+
+要实现您自己的Dubbo扩展,通常只需依赖API jar就可以满足您的需求。例如:
+
+```xml
+<dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-serialization-api</artifactId>
+ <version>${dubbo.version}</version>
+</dependency>
+```
+
+### Src指导
+
+通常,要实现特殊的扩展,只需要参考[开发者指南](http://dubbo.apache.org/#/docs/dev/build.md?lang=en-us),实现Dubbo必要的接口和合适的扩展即可。除此之外,还有一些其它的事项需要注意:
+
+1. 良好的测试,您需要编写单元测试和冒烟测试以消除潜在的bug。
+2. 没有警告,如有不可避免的警告,请使用@SuppressWarnings阻止它,但是请不要乱用。
+3. README。添加必要的自述以说明如何使用扩展,以及需要注意的事项。
+4. 许可证:请确保使用Apache License 2.0。
+
+### 通知社区
+
+1. 提交您的代码到[github](https://github.com)。
+2. 加入邮件列表(建议)。点击[这里](https://github.com/apache/dubbo/wiki/Mailing-list-subscription-guide)查看如何加入邮件列表。
+3. 发送一封邮件到dev@incubator.dubbo.apache.org通知社区。
+4. 通常,发送邮件之后,社区会对您的扩展进行讨论,dubbo组的管理员会联系您转移您的项目到dubbo生态系统。
+
+### 转移项目到dubbo生态系统
+
+1. dubbo组的管理员会请您将您的项目的所有者转让给dubbo。
+2. dubbo组的管理员会在dubbo组下新建一个项目并邀请您加入到这个项目。
+3. 一旦您接受邀请,您可以将您的项目转移到dubbo组下的新项目里。
+4. dubbo组的成员会对您的项目进行代码审查。随后,您可以对这些代码进行改进。
+
+
+
+
+
diff --git a/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/mailing-list-subscription-guide_dev.md b/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/mailing-list-subscription-guide_dev.md
new file mode 100644
index 0000000..5ee9945
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/mailing-list-subscription-guide_dev.md
@@ -0,0 +1,80 @@
+# 邮件列表订阅向导
+
+Apache incubator的Dubbo开发者邮件列表(dev@dubbo.apache.org)已经建立,请随时订阅并参考[^1]获取更多细节。
+
+你也可以直接查看[历史邮件](https://lists.apache.org/list.html?dev@dubbo.apache.org)
+
+下面是一个关于Dubbo邮件列表订阅的简短指南:
+
+1. 发一封邮件到dev-subscribe@dubbo.apache.org,其内容和标题均可为空。随后,您会收到一封邮件,其内容如下:
+
+```
+from: dev-help@dubbo.apache.org
+reply-to: dev-sc.xxxxxxx.xxxxxxxx-hello=example.com@dubbo.apache.org
+to: hello@example.com
+date: Sat, Feb 24, 2018 at 3:12 PM
+subject: confirm subscribe to dev@dubbo.apache.org
+mailed-by: apache.org
+
+Hi! This is the ezmlm program. I'm managing the
+dev@dubbo.apache.org mailing list.
+
+I'm working for my owner, who can be reached
+at dev-owner@dubbo.apache.org.
+
+To confirm that you would like
+
+ hello@example.com
+
+added to the dev mailing list, please send
+a short reply to this address:
+
+ dev-sc.xxxxxxx.xxxxxxxx-hello=example.com@dubbo.apache.org
+
+Usually, this happens when you just hit the "reply" button.
+If this does not work, simply copy the address and paste it into
+the "To:" field of a new message.
+
+or click here:
+ mailto:dev-sc.xxxxxxx.xxxxxxxx-hello=example.com@dubbo.apache.org
+
+...
+```
+
+2. 直接回复邮件,其内容和标题仍然可以为空,随后,您将再次收到一封邮件,其内容如下:
+
+```
+from: dev-help@dubbo.apache.org
+to: hello@example.com
+date: Sat, Feb 24, 2018 at 3:14 PM
+subject: WELCOME to dev@dubbo.apache.org
+mailed-by: apache.org
+
+Hi! This is the ezmlm program. I'm managing the
+dev@dubbo.apache.org mailing list.
+
+I'm working for my owner, who can be reached
+at dev-owner@dubbo.apache.org.
+
+Acknowledgment: I have added the address
+
+ hello@example.com
+
+to the dev mailing list.
+
+Welcome to dev@dubbo.apache.org!
+
+Please save this message so that you know the address you are
+subscribed under, in case you later want to unsubscribe or change your
+subscription address.
+
+...
+```
+
+3. 到此,邮件列表订阅完毕,从现在开始,您将收到很多发送到该邮件列表的邮件,如果您有更多的问题,只需发送邮件到dev@dubbo.apache.org,就会有人回答您的问题。
+
+4. 如果您想取消订阅,只需发送一封邮件到dev-unsubscribe@dubbo.apache.org,收到回复后,请按其指定步骤执行。
+
+> 请注意:dev@dubbo.apache.org和dev@dubbo.apache.org都是有效的, 您可以订阅它们中的任何一个。
+
+[^1] http://apache.org/foundation/mailinglists.html#subscribing
diff --git a/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/new-contributor-guide_dev.md b/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/new-contributor-guide_dev.md
new file mode 100644
index 0000000..7e79ab8
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/new-contributor-guide_dev.md
@@ -0,0 +1,36 @@
+# 新贡献者向导
+
+这篇向导旨在给正在准备向Dubbo提交贡献的新手提供指导。
+
+### 邮件列表描述
+
+邮件列表是Dubbo官方推荐的讨论方式,所有与Dubbo相关的内容都可以在这里讨论,请点击 [issue](https://github.com/apache/dubbo/issues/1393) 了解更多关于邮件列表订阅的内容
+
+* dev@dubbo.apache.org:开发邮件列表,您在使用或者开发Dubbo的过程中遇到的任何问题,都可以在这里进行提问。
+* commits@dubbo.apache.org:所有的提交内容都会推送到这个邮件列表,如果您对Dubbo的进展感兴趣,可以订阅这个邮件列表。
+* issues@dubbo.apache.org:所有的 JIRA [issues](https://issues.apache.org/jira/projects/DUBBO/issues) 和修改信息都会推送到这个邮件列表。Dubbo社区已经决定使用github issues代替JIRA issues,因此大部分issues将由github issues进行跟踪。JIRA issues用于跟踪ASF相关问题。
+
+### 报告问题
+
+### 发送 pull request
+
+* 参考[pull request template](https://github.com/apache/dubbo/blob/master/PULL_REQUEST_TEMPLATE.md)中的检查列表
+* 在您发送pull request之前,请同步您的github仓库和远程仓库,这会使您的pull request简单明了,具体操作请看如下所示步骤:
+
+```sh
+git remote add upstream git@github.com:apache/dubbo.git
+git fetch upstream
+git rebase upstream/master
+git checkout -b your_awesome_patch
+... add some work
+git push origin your_awesome_patch
+```
+
+### 编码规范
+
+请按照[CONTRIBUTING.md](https://github.com/apache/dubbo/blob/master/CONTRIBUTING.md)中的编码规范对自己的代码进行检查。
+
+
+### 参与发布投票
+
+参与发布投票是一种重要的贡献社区的方式,Dubbo社区非常欢迎和鼓励任何人参与投票,每当一个版本需要正式发布的时候,会在开发者邮件列表上进行发布投票,只有当投票取得通过之后,才会正式发布,可以参考这个[检查列表](https://wiki.apache.org/incubator/IncubatorReleaseChecklist)对源码进行合规性检查。如果有任何问题,可以在开发者邮件列表上提问。
diff --git a/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/reporting-security-issues_dev.md b/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/reporting-security-issues_dev.md
new file mode 100644
index 0000000..b8a7182
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/reporting-security-issues_dev.md
@@ -0,0 +1,21 @@
+# Reporting Security Issues
+
+The Apache Software Foundation takes a rigorous standpoint in annihilating the security issues in its software projects. Apache Dubbo is highly sensitive and forthcoming to issues pertaining to its features and functionality.
+
+## REPORTING VULNERABILITY
+
+If you have apprehensions regarding Dubbo's security or you discover vulnerability or potential threat, don’t hesitate to get in touch with the Apache Dubbo Security Team by dropping a mail at security@dubbo.apache.org. In the mail, specify the description of the issue or potential threat. You are also urged to recommend the way to reproduce and replicate the issue. The Dubbo community will get back to you after assessing and analysing the findings.
+
+PLEASE PAY ATTENTION to report the security issue on the security email before disclosing it on public domain.
+
+
+## VULNERABILITY HANDLING
+
+An overview of the vulnerability handling process is:
+
+* The reporter reports the vulnerability privately to Apache.
+* The appropriate project's security team works privately with the reporter to resolve the vulnerability.
+* A new release of the Apache product concerned is made that includes the fix.
+* The vulnerability is publically announced.
+
+A more detailed description of the process can be found [here](https://www.apache.org/security/committers.html)
diff --git a/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/software-donation-guide_dev.md b/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/software-donation-guide_dev.md
new file mode 100644
index 0000000..048777c
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/software-donation-guide_dev.md
@@ -0,0 +1,112 @@
+# 软件捐献向导
+
+在您阅读这篇指南之前,请确保您已经向PMC确认了实际需要的SGA。
+
+如果您向Apache Dubbo 捐赠了大量的代码或文档,则需要在合并代码或者文档之前签署[软件授权书](https://www.apache.org/licenses/#grants)。
+
+### 操作步骤
+
+1. 下载这篇[pdf文档](https://www.apache.org/licenses/software-grant-template.pdf)
+
+2. 打印下载好的文档
+
+3. 按要求填充表格(请看下边示例)
+
+4. 请您的领导在上边签字
+
+5. 扫描
+
+6. 将扫描好的文档以邮件的方式发送给secretary@apache.org,并抄送给private@dubbo.apache.org
+
+### 示例
+
+下边是一个文本示例,原始文本可以在[这里](https://www.apache.org/licenses/software-grant.txt)找到
+
+```
+License Agreement
+
+
+ This License Agreement is entered into as of the _12th_ day of
+___April____, __2018__ by ___ABC Software Co., Ltd.____ ("Licensor"),
+in favor of The Apache Software Foundation, a Delaware nonstock
+membership corporation (the "Foundation").
+
+ WHEREAS, Licensor owns or has sufficient rights to contribute the
+software source code and other related intellectual property as
+itemized on Exhibit A ("Software") under the terms of this agreement
+to the Foundation for use within Foundation software development
+projects ("Projects").
+
+ NOW, THEREFORE, FOR GOOD AND VALUABLE CONSIDERATION, the receipt
+and legal sufficiency of which are hereby acknowledged, the parties
+hereto, intending to be legally bound, agree as follows:
+
+1. Subject to the terms and conditions of this License, Licensor
+hereby grants to the Foundation:
+
+ a) a non-exclusive, worldwide, royalty-free, irrevocable
+ copyright license to reproduce, prepare derivative works of,
+ publicly display, publicly perform, distribute and sublicense,
+ internally and externally, the Software and such derivative
+ works, in source code and object code form; and,
+
+ b) a non-exclusive, worldwide, royalty-free, irrevocable
+ patent license under Licensed Patents to make, use, sell,
+ offer to sell, import and otherwise transfer the Software
+ in source code and object code form. "Licensed Patents" mean
+ patent claims owned by Licensor which are necessarily
+ infringed by the use or sale of the Software alone.
+
+2. Licensor represents that, to Licensor's knowledge, Licensor is
+legally entitled to grant the above license. Licensor agrees to notify
+the Foundation of any facts or circumstances of which Licensor becomes
+aware and which makes or would make Licensor's representations in this
+License Agreement inaccurate in any respect.
+
+3. This Software is provided AS-IS, WITHOUT WARRANTIES OR CONDITIONS
+OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
+ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. NEITHER THE LICENSOR NOR ITS
+SUPPLIERS WILL BE LIABLE TO THE FOUNDATION OR ITS LICENSEES FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED
+AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+THE USE OR DISTRIBUTION OF THE WORK OR THE EXERCISE OF ANY RIGHTS
+GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+This License Agreement is the entire agreement of the parties
+with respect to its subject matter, and may only be amended by a
+writing signed by each party. This License Agreement may be
+executed in one or more counterparts, each of which shall be
+considered an original.
+
+ IN WITNESS WHEREOF, Licensor has executed this License Agreement
+as of the date first written above.
+
+
+ LICENSOR:
+
+
+ Signed By: _____________________________________ <--- Your boss's sign here
+
+ Print Name: _____Lei Li_________________________ <--- Your boss's name here
+
+ Title: ____Director_____________________________ <--- Your boss's title here
+
+ Representing: ____ABC Software Co., Ltd. _______
+
+ ________________________________________________
+
+ Contact Name: ____Lei Li________________________ <--- Your boss's name here
+
+ Contact Email: ____lilei@abc.com________________ <--- Your boss's email here
+
+Exhibit A
+
+List of software and other intellectual property covered by this agreement:
+
+* Github address where your code is hosted
+* Pull request link
+```
+
diff --git a/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/test-coverage-guide_dev.md b/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/test-coverage-guide_dev.md
new file mode 100644
index 0000000..47c6ce4
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/developers/contributor-guide/test-coverage-guide_dev.md
@@ -0,0 +1,16 @@
+# 测试覆盖率向导
+
+### 1.写单元测试的收益
+ * 单元测试能帮助每个人深入代码细节,了解代码的功能。
+ * 通过测试用例我们能发现bug,并提交代码的健壮性。
+ * 测试用例同时也是代码的demo用法。
+### 2.单元测试用例的一些设计原则
+ * 应该精心设计好步骤,颗粒度和组合条件。
+ * 注意边界条件。
+ * 单元测试也应该好好设计,不要写无用的代码。
+ * 当你发现一个`方法`很难写单元测试时,如果可以确认这个`方法`是`臭代码`,那么就和开发者一起重构它。
+ * Dubbo中用的mock框架是: [mockito](http://site.mockito.org/). 下面是一些开发向导:[mockito tutorial](http://www.baeldung.com/bdd-mockito),[mockito refcard](https://dzone.com/refcardz/mockito)
+ * TDD(可选):当你开始写一个新的功能时,你可以试着先写测试用例。
+### 3.测试覆盖率设定值
+ * 在现阶段,Delta更改代码的测试覆盖设定值为:>=60%,越高越好。
+ * 我们可以在这个页面中看到测试报告: https://codecov.io/gh/apache/dubbo
diff --git a/doc-archive/v2.7.3/docs/zh-cn/developers/developers_dev.md b/doc-archive/v2.7.3/docs/zh-cn/developers/developers_dev.md
new file mode 100644
index 0000000..5ea8c3f
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/developers/developers_dev.md
@@ -0,0 +1,55 @@
+## 开发人员
+
+本页面展示了Dubbo的开发团队。请通过提交PR的方式把自己的信息添加到列表上。注:排名不分先后
+
+### 提交者
+
+| Apache ID | Name | Organization | Role | TimeZone |
+| --------------- | ------------------- | ------------ | --------- | -------- |
+| jmclean | Justin Mclean | Apache | Mentor | +11 |
+| markt | Mark Thomas | Apache | Mentor | +0 |
+| wave | Dave Fisher | Apache | Mentor | |
+| johndament | John D. Ament | retired | Mentor | |
+| jfclere | Jean-Frederic Clere | retired | Mentor | |
+| huxing | Huxing Zhang | Alibaba | PMC | +8 |
+| vongosling | Von Gosling | Alibaba | PMC | +8 |
+| iluo | Ian Luo | Alibaba | PMC | +8 |
+| liujun | Jun Liu | Alibaba | PMC | +8 |
+| zhangliang | Liang Zhang | Jingdong | PMC | +8 |
+| liujieqin | Liujie Qin | Alibaba | PMC | +8 |
+| mercyblitz | Mercy Ma | Alibaba | PMC | +8 |
+| wangxin | Xin Wang | Weidian | PMC | +8 |
+| yiji | Shang Zonghai | Youzan | PMC | +8 |
+| jerrick | Yong Zhu | Alibaba | PMC | +8 |
+| carryxyh | Yuhang Xiu | Netease | PMC | +8 |
+| hyunkun | YunKun Huang | Meituan-Dianping | PMC | +8 |
+| min | Minxuan Zhuang | Alibaba | PMC | +8 |
+| kimmking | Kimm King | Rongguan | PMC | +8 |
+| leonleeldc | Dingcheng Li | Alibaba | Committer | +8 |
+| yuyijq | Zhaohui Yu | Qunar | Committer | +8 |
+| mjk | Jinkai Ma | Handuyishe | Committer | +8 |
+| yizhenqiang | Zhenqiang Yi | Didi | Committer | +8 |
+| victory | Victory Cao | Alibaba | Committer | +8 |
+| purpleforce | Liandong Chen | Alibaba | Committer | +8 |
+| jefflv | Jeff Lv | Alibaba | Committer | +8 |
+| tswstarplanet | Taosheng Wei | NetsUnion | Committer | +8 |
+| kexianjun | Xianjun Ke | Caocaokeji | Committer | +8 |
+| songkun | Kun Song | Huawei | Committer | +8 |
+| lixiaojie | Xiaojie Li | GomeFinance | Committer | +8 |
+| biyuhao | Yuhao Bi | Asiainfo-sec | Committer | +8 |
+| crazyhzm | Zhongming Hua | iFlytek | Committer | +8 |
+| kezhenxu94 | Zhenxu Ke | Lizhi FM | Committer | +8 |
+| LiZhenNet | Zhen Li | Keep | Committer | +8 |
+| lexburner | Jingfeng Xu | Alibaba | Committer | +8 |
+| khanimteyaz | Imteyaz Khan | | Committer | |
+| xxz | Xiaoxiang Zhai | Souche | Committer | +8 |
+
+### 贡献者
+
+| Github ID | Github URL | 组织 | 时区 |
+| ---------- | ------------------------------- | ------------ | ---- |
+| leyou240 | <https://github.com/leyou240> | | +8 |
+| chenzhiguo | <https://github.com/chenzhiguo> | | +8 |
+| huyuechy | <https://github.com/huyuechy> | | +8 |
+| caojiele | <https://github.com/caojiele> | | +8 |
+
diff --git a/doc-archive/v2.7.3/docs/zh-cn/developers/guide_dev.md b/doc-archive/v2.7.3/docs/zh-cn/developers/guide_dev.md
new file mode 100644
index 0000000..f888b34
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/developers/guide_dev.md
@@ -0,0 +1,82 @@
+## 为Dubbo做贡献
+
+Dubbo是在非限制性的Apache 2.0许可下发布的,遵循标准的Github开发流程,使用Github追踪处理问题,并将pull request合并到master中。如果您想为Dubbo 做贡献(即便是一些微小的),请不要犹豫,遵循下面的指导方针。
+
+### 签署贡献者许可协议
+在我们接受一个补丁或pull request之前,我们需要您签署贡献者许可协议。签署贡献者协议并不授予任何人对代码仓库的提交权限,但是它意味着我们可以接受您的贡献,并且如果我们这样做,您将获得一个作者标注。主动贡献者可能会被邀请加入核心团队,并有权限合并pull request。
+
+### 联系我们
+
+#### 邮件列表
+
+
+邮件列表是讨论几乎所有与Dubbo有关事情的推荐方式。有关如何订阅的详细文档,请参阅[指南](https://github.com/apache/dubbo/wiki/Mailing-list-subscription-guide)。
+
+- [dev@dubbo.apache.org](mailto:dev-subscribe@dubbo.apache.org): 开发邮件列表,如果您在使用或开发Dubbo时遇到任何问题,您可以在此提出问题。
+- [commits@dubbo.apache.org](mailto:commits-subscribe@dubbo.apache.org): 所有提交将被发送到这个邮件列表。如果您对Dubbo的发展感兴趣,您可以订阅它。
+- [notification@dubbo.apache.org](mailto:notification-subscribe@dubbo.apache.org): 所有Github [issue](https://github.com/apache/dubbo/issues)和[pull request](https://github.com/apache/dubbo/pulls)的更新都会被发送到这个邮件列表。
+
+### 报告问题
+
+在报告任何问题时请遵循[模版](https://github.com/apache/dubbo/issues/new?template=dubbo-issue-report-template.md)。
+
+### 代码约定
+我们的代码风格几乎和标准Java约定一致(流行IDE的默认设置满足这一点),主要有以下附加限制:
+
+* 如果当前行中有超过120个字符,则起一个新的行。
+
+* 确保所有新的.java文件都有一个简单的JavaDoc类注释,其中至少有一个标识创建日期的标签,最好至少有一个关于该类的解释说明。
+
+* 将ASF许可注释添加到所有新的.java文件(从项目中的现有文件复制)
+
+* 请确保没有将@author标记添加到您所贡献的文件中,因为Apache不使用@author标记,其他方式(如cvs)将公平地记录所有您的贡献。
+
+* 为代码添加一些JavaDoc,如果您更改命名空间,则需要一些XSD DOC元素。
+
+* 对于新的特征或重要的修复程序,应该添加单元测试。
+
+* 如果没有其他人使用您的分支,请将它与master(或主项目中的其他目标分支)同步。
+
+* 当编写提交消息时,请遵循这些约定,如果您正在修复一个现有问题,请在提交消息的末尾添加Fixes XXX(其中XXX是问题编号)。
+
+### 贡献流程
+
+这是一个贡献者工作流程的大致说明:
+
+* 克隆当前项目
+* 从希望贡献的分支上创新新的分支,通常是master分支。
+* 提交您的更改。
+* 确保提交消息的格式正确。
+* 将新分支推送到您克隆的代码库中。
+* 执行检查表 [pull request模版](https://github.com/apache/dubbo/blob/master/PULL_REQUEST_TEMPLATE.md)。
+* 在提交pull requsest请求前, 请将您克隆的代码和远程代码库同步,这样您的pull request会简单清晰。具体操作如下:
+```
+git remote add upstream git@github.com:apache/dubbo.git
+git fetch upstream
+git rebase upstream/master
+git checkout -b your_awesome_patch
+... add some work
+git push origin your_awesome_patch
+```
+* 提交pull request请求到apache/dubbo并等待回复。
+
+谢谢您的贡献!
+
+### 代码风格
+
+
+我们提供了IntelliJ idea的模版文件[dubbo_codestyle_for_idea.xml](https://github.com/apache/dubbo/tree/master/codestyle/dubbo_codestyle_for_idea.xml),您可以将它导入到IDE。
+
+如果使用Eclipse,可以通过参考该文件手动配置。
+
+**注意事项**
+
+使用 dubbo_codestyle_for_idea.xml 为你的 IDEA 设置代码格式是贡献代码前至关重要的一个步骤,否则你将会无法通过 Travis CI 的代码风格校验,下面几个步骤给你演示了如何配置代码格式:
+
+1. 进入菜单页 `Editor > Code Style`
+2. 在 Code Style 页面的 scheme 菜单中点击  选项
+在下拉列表中选择 `Import Scheme`, 接着选择 `IntelliJ IDEA code style XML` 导入 xml 文件
+3. 输入你的格式名称,方便在不同工程之间进行识别,最后别忘了 ⏎ 来保存更改.
+
+设置完成后,IDEA 会帮助你自动 reformat 代码
+
diff --git a/doc-archive/v2.7.3/docs/zh-cn/developers/user-guide/faq_dev.md b/doc-archive/v2.7.3/docs/zh-cn/developers/user-guide/faq_dev.md
new file mode 100644
index 0000000..08fefb2
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/developers/user-guide/faq_dev.md
@@ -0,0 +1,25 @@
+# FAQ
+
+### dubbo-admin在哪里?
+
+从Dubbo 2.6.1版本开始,dubbo-admin已经从核心库迁移到https://github.com/apache/dubbo-admin
+
+### 我应该选择哪个版本?
+
+目前,dubbo保持着3个版本的并行推进:
+
+* 2.7.x (master) :要求java 1.8,重要功能分支。
+* 2.6.x:要求java 1.6,次要功能、bug修复分支,GA,生产准备。
+* 2.5.x:要求java 1.6,维护分支,只接受具有安全漏洞和致命性错误的bugfix,该分支将会在2019-06-15停止维护,请尽快升级到2.6.x版本。
+
+点击[这里](https://github.com/apache/dubbo/issues/1208)以了解更详细的版本管理计划。
+
+对于贡献者,请确保所有的变更都提交到正确的分支上,也就是说,大多数的pull request都必须提交到2.7.x上,如有必要,将其反向合并到2.6.x和2.5.x上,如果是针对指定分支的bugfix,也请确保您的pull request提交到了正确的分支上。
+
+对于提交者,请给每一个PR选择正确的标签和分支,如有必要,也请不要忘记将bugfix反向合并到低版本分支
+
+### 如何在docker中正确地注册ip?
+
+[示例问题](https://github.com/alibaba/dubbo/issues/742)
+
+Dubbo支持通过配置系统环境参数的方式指定ip/port,点击[这里](https://github.com/dubbo/dubbo-samples/tree/master/dubbo-samples-docker)可以查看详细示例。
diff --git a/doc-archive/v2.7.3/docs/zh-cn/source_code_guide/adaptive-extension.md b/doc-archive/v2.7.3/docs/zh-cn/source_code_guide/adaptive-extension.md
new file mode 100644
index 0000000..97bfe4e
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/source_code_guide/adaptive-extension.md
@@ -0,0 +1,788 @@
+---
+title: SPI 自适应拓展
+keywords: Dubbo, SPI, Adaptive Extension
+description: 本文介绍了自适应拓展的原理和实现细节
+---
+
+## 1.原理
+
+在 Dubbo 中,很多拓展都是通过 SPI 机制进行加载的,比如 Protocol、Cluster、LoadBalance 等。有时,有些拓展并不想在框架启动阶段被加载,而是希望在拓展方法被调用时,根据运行时参数进行加载。这听起来有些矛盾。拓展未被加载,那么拓展方法就无法被调用(静态方法除外)。拓展方法未被调用,拓展就无法被加载。对于这个矛盾的问题,Dubbo 通过自适应拓展机制很好的解决了。自适应拓展机制的实现逻辑比较复杂,首先 Dubbo 会为拓展接口生成具有代理功能的代码。然后通过 javassist 或 jdk 编译这段代码,得到 Class 类。最后再通过反射创建代理类,整个过程比较复杂。为了让大家对自适应拓展有一个感性的认识,下面我们通过一个示例进行演示。这是一个与汽车相关的例子,我们有一个车轮制造厂接口 WheelMaker:
+
+```java
+public interface WheelMaker {
+ Wheel makeWheel(URL url);
+}
+```
+
+WheelMaker 接口的自适应实现类如下:
+
+
+```java
+public class AdaptiveWheelMaker implements WheelMaker {
+ public Wheel makeWheel(URL url) {
+ if (url == null) {
+ throw new IllegalArgumentException("url == null");
+ }
+
+ // 1.从 URL 中获取 WheelMaker 名称
+ String wheelMakerName = url.getParameter("Wheel.maker");
+ if (wheelMakerName == null) {
+ throw new IllegalArgumentException("wheelMakerName == null");
+ }
+
+ // 2.通过 SPI 加载具体的 WheelMaker
+ WheelMaker wheelMaker = ExtensionLoader
+ .getExtensionLoader(WheelMaker.class).getExtension(wheelMakerName);
+
+ // 3.调用目标方法
+ return wheelMaker.makeWheel(URL url);
+ }
+}
+```
+
+AdaptiveWheelMaker 是一个代理类,与传统的代理逻辑不同,AdaptiveWheelMaker 所代理的对象是在 makeWheel 方法中通过 SPI 加载得到的。makeWheel 方法主要做了三件事情:
+
+1. 从 URL 中获取 WheelMaker 名称
+2. 通过 SPI 加载具体的 WheelMaker 实现类
+3. 调用目标方法
+
+接下来,我们来看看汽车制造厂 CarMaker 接口与其实现类。
+
+```java
+public interface CarMaker {
+ Car makeCar(URL url);
+}
+
+public class RaceCarMaker implements CarMaker {
+ WheelMaker wheelMaker;
+
+ // 通过 setter 注入 AdaptiveWheelMaker
+ public setWheelMaker(WheelMaker wheelMaker) {
+ this.wheelMaker = wheelMaker;
+ }
+
+ public Car makeCar(URL url) {
+ Wheel wheel = wheelMaker.makeWheel(url);
+ return new RaceCar(wheel, ...);
+ }
+}
+```
+
+RaceCarMaker 持有一个 WheelMaker 类型的成员变量,在程序启动时,我们可以将 AdaptiveWheelMaker 通过 setter 方法注入到 RaceCarMaker 中。在运行时,假设有这样一个 url 参数传入:
+
+```url
+dubbo://192.168.0.101:20880/XxxService?wheel.maker=MichelinWheelMaker
+```
+
+RaceCarMaker 的 makeCar 方法将上面的 url 作为参数传给 AdaptiveWheelMaker 的 makeWheel 方法,makeWheel 方法从 url 中提取 wheel.maker 参数,得到 MichelinWheelMaker。之后再通过 SPI 加载配置名为 MichelinWheelMaker 的实现类,得到具体的 WheelMaker 实例。
+
+上面的示例展示了自适应拓展类的核心实现 ---- 在拓展接口的方法被调用时,通过 SPI 加载具体的拓展实现类,并调用拓展对象的同名方法。接下来,我们深入到源码中,探索自适应拓展类生成的过程。
+
+## 2.源码分析
+
+在对自适应拓展生成过程进行深入分析之前,我们先来看一下与自适应拓展息息相关的一个注解,即 Adaptive 注解。该注解的定义如下:
+
+```java
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE, ElementType.METHOD})
+public @interface Adaptive {
+ String[] value() default {};
+}
+```
+
+从上面的代码中可知,Adaptive 可注解在类或方法上。当 Adaptive 注解在类上时,Dubbo 不会为该类生成代理类。注解在方法(接口方法)上时,Dubbo 则会为该方法生成代理逻辑。Adaptive 注解在类上的情况很少,在 Dubbo 中,仅有两个类被 Adaptive 注解了,分别是 AdaptiveCompiler 和 AdaptiveExtensionFactory。此种情况,表示拓展的加载逻辑由人工编码完成。更多时候,Adaptive 是注解在接口方法上的,表示拓展的加载逻辑需由框架自动生成。Adaptive 注解的地方不同,相应的处理逻辑也是不同的。注解在类上时,处理逻辑比较简单,本文就不分析了。注解在接口方法上时,处理逻辑较为复杂,本章将会重点分析此块逻辑。
+
+### 2.1 获取自适应拓展
+
+getAdaptiveExtension 方法是获取自适应拓展的入口方法,因此下面我们从这个方法进行分析。相关代码如下:
+
+```java
+public T getAdaptiveExtension() {
+ // 从缓存中获取自适应拓展
+ Object instance = cachedAdaptiveInstance.get();
+ if (instance == null) { // 缓存未命中
+ if (createAdaptiveInstanceError == null) {
+ synchronized (cachedAdaptiveInstance) {
+ instance = cachedAdaptiveInstance.get();
+ if (instance == null) {
+ try {
+ // 创建自适应拓展
+ instance = createAdaptiveExtension();
+ // 设置自适应拓展到缓存中
+ cachedAdaptiveInstance.set(instance);
+ } catch (Throwable t) {
+ createAdaptiveInstanceError = t;
+ throw new IllegalStateException("fail to create adaptive instance: ...");
+ }
+ }
+ }
+ } else {
+ throw new IllegalStateException("fail to create adaptive instance: ...");
+ }
+ }
+
+ return (T) instance;
+}
+```
+
+getAdaptiveExtension 方法首先会检查缓存,缓存未命中,则调用 createAdaptiveExtension 方法创建自适应拓展。下面,我们看一下 createAdaptiveExtension 方法的代码。
+
+```java
+private T createAdaptiveExtension() {
+ try {
+ // 获取自适应拓展类,并通过反射实例化
+ return injectExtension((T) getAdaptiveExtensionClass().newInstance());
+ } catch (Exception e) {
+ throw new IllegalStateException("Can not create adaptive extension ...");
+ }
+}
+```
+createAdaptiveExtension 方法的代码比较少,但却包含了三个逻辑,分别如下:
+
+1. 调用 getAdaptiveExtensionClass 方法获取自适应拓展 Class 对象
+2. 通过反射进行实例化
+3. 调用 injectExtension 方法向拓展实例中注入依赖
+
+前两个逻辑比较好理解,第三个逻辑用于向自适应拓展对象中注入依赖。这个逻辑看似多余,但有存在的必要,这里简单说明一下。前面说过,Dubbo 中有两种类型的自适应拓展,一种是手工编码的,一种是自动生成的。手工编码的自适应拓展中可能存在着一些依赖,而自动生成的 Adaptive 拓展则不会依赖其他类。这里调用 injectExtension 方法的目的是为手工编码的自适应拓展注入依赖,这一点需要大家注意一下。关于 injectExtension 方法,前文已经分析过了,这里不再赘述。接下来,分析 getAdaptiveExtensionClass 方法的逻辑。
+
+```java
+private Class<?> getAdaptiveExtensionClass() {
+ // 通过 SPI 获取所有的拓展类
+ getExtensionClasses();
+ // 检查缓存,若缓存不为空,则直接返回缓存
+ if (cachedAdaptiveClass != null) {
+ return cachedAdaptiveClass;
+ }
+ // 创建自适应拓展类
+ return cachedAdaptiveClass = createAdaptiveExtensionClass();
+}
+```
+
+getAdaptiveExtensionClass 方法同样包含了三个逻辑,如下:
+
+1. 调用 getExtensionClasses 获取所有的拓展类
+2. 检查缓存,若缓存不为空,则返回缓存
+3. 若缓存为空,则调用 createAdaptiveExtensionClass 创建自适应拓展类
+
+这三个逻辑看起来平淡无奇,似乎没有多讲的必要。但是这些平淡无奇的代码中隐藏了着一些细节,需要说明一下。首先从第一个逻辑说起,getExtensionClasses 这个方法用于获取某个接口的所有实现类。比如该方法可以获取 Protocol 接口的 DubboProtocol、HttpProtocol、InjvmProtocol 等实现类。在获取实现类的过程中,如果某个某个实现类被 Adaptive 注解修饰了,那么该类就会被赋值给 cachedAdaptiveClass 变量。此时,上面步骤中的第二步条件成立(缓存不为空),直接返回 cachedAdaptiveClass 即可。如果所有的实现类均未被 Adaptive 注解修饰,那么执行第三步逻辑,创建自适应拓展类。相关代码如下:
+
+```java
+private Class<?> createAdaptiveExtensionClass() {
+ // 构建自适应拓展代码
+ String code = createAdaptiveExtensionClassCode();
+ ClassLoader classLoader = findClassLoader();
+ // 获取编译器实现类
+ com.alibaba.dubbo.common.compiler.Compiler compiler = ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.common.compiler.Compiler.class).getAdaptiveExtension();
+ // 编译代码,生成 Class
+ return compiler.compile(code, classLoader);
+}
+```
+
+createAdaptiveExtensionClass 方法用于生成自适应拓展类,该方法首先会生成自适应拓展类的源码,然后通过 Compiler 实例(Dubbo 默认使用 javassist 作为编译器)编译源码,得到代理类 Class 实例。接下来,我们把重点放在代理类代码生成的逻辑上,其他逻辑大家自行分析。
+
+### 2.2 自适应拓展类代码生成
+
+createAdaptiveExtensionClassCode 方法代码略多,约有两百行代码。因此本节将会对该方法的代码进行拆分分析,以帮助大家更好的理解代码逻辑。
+
+#### 2.2.1 Adaptive 注解检测
+
+在生成代理类源码之前,createAdaptiveExtensionClassCode 方法首先会通过反射检测接口方法是否包含 Adaptive 注解。对于要生成自适应拓展的接口,Dubbo 要求该接口至少有一个方法被 Adaptive 注解修饰。若不满足此条件,就会抛出运行时异常。相关代码如下:
+
+```java
+// 通过反射获取所有的方法
+Method[] methods = type.getMethods();
+boolean hasAdaptiveAnnotation = false;
+// 遍历方法列表
+for (Method m : methods) {
+ // 检测方法上是否有 Adaptive 注解
+ if (m.isAnnotationPresent(Adaptive.class)) {
+ hasAdaptiveAnnotation = true;
+ break;
+ }
+}
+
+if (!hasAdaptiveAnnotation)
+ // 若所有的方法上均无 Adaptive 注解,则抛出异常
+ throw new IllegalStateException("No adaptive method on extension ...");
+```
+
+#### 2.2.2 生成类
+
+通过 Adaptive 注解检测后,即可开始生成代码。代码生成的顺序与 Java 文件内容顺序一致,首先会生成 package 语句,然后生成 import 语句,紧接着生成类名等代码。整个逻辑如下:
+
+```java
+// 生成 package 代码:package + type 所在包
+codeBuilder.append("package ").append(type.getPackage().getName()).append(";");
+// 生成 import 代码:import + ExtensionLoader 全限定名
+codeBuilder.append("\nimport ").append(ExtensionLoader.class.getName()).append(";");
+// 生成类代码:public class + type简单名称 + $Adaptive + implements + type全限定名 + {
+codeBuilder.append("\npublic class ")
+ .append(type.getSimpleName())
+ .append("$Adaptive")
+ .append(" implements ")
+ .append(type.getCanonicalName())
+ .append(" {");
+
+// ${生成方法}
+
+codeBuilder.append("\n}");
+```
+
+这里使用 ${...} 占位符代表其他代码的生成逻辑,该部分逻辑将在随后进行分析。上面代码不是很难理解,下面直接通过一个例子展示该段代码所生成的内容。以 Dubbo 的 Protocol 接口为例,生成的代码如下:
+
+```java
+package com.alibaba.dubbo.rpc;
+import com.alibaba.dubbo.common.extension.ExtensionLoader;
+public class Protocol$Adaptive implements com.alibaba.dubbo.rpc.Protocol {
+ // 省略方法代码
+}
+```
+
+#### 2.2.3 生成方法
+
+一个方法可以被 Adaptive 注解修饰,也可以不被修饰。这里将未被 Adaptive 注解修饰的方法称为“无 Adaptive 注解方法”,下面我们先来看看此种方法的代码生成逻辑是怎样的。
+
+##### 2.2.3.1 无 Adaptive 注解方法代码生成逻辑
+
+对于接口方法,我们可以按照需求标注 Adaptive 注解。以 Protocol 接口为例,该接口的 destroy 和 getDefaultPort 未标注 Adaptive 注解,其他方法均标注了 Adaptive 注解。Dubbo 不会为没有标注 Adaptive 注解的方法生成代理逻辑,对于该种类型的方法,仅会生成一句抛出异常的代码。生成逻辑如下:
+
+```java
+for (Method method : methods) {
+
+ // 省略无关逻辑
+
+ Adaptive adaptiveAnnotation = method.getAnnotation(Adaptive.class);
+ StringBuilder code = new StringBuilder(512);
+ // 如果方法上无 Adaptive 注解,则生成 throw new UnsupportedOperationException(...) 代码
+ if (adaptiveAnnotation == null) {
+ // 生成的代码格式如下:
+ // throw new UnsupportedOperationException(
+ // "method " + 方法签名 + of interface + 全限定接口名 + is not adaptive method!”)
+ code.append("throw new UnsupportedOperationException(\"method ")
+ .append(method.toString()).append(" of interface ")
+ .append(type.getName()).append(" is not adaptive method!\");");
+ } else {
+ // 省略无关逻辑
+ }
+
+ // 省略无关逻辑
+}
+```
+
+以 Protocol 接口的 destroy 方法为例,上面代码生成的内容如下:
+
+```java
+throw new UnsupportedOperationException(
+ "method public abstract void com.alibaba.dubbo.rpc.Protocol.destroy() of interface com.alibaba.dubbo.rpc.Protocol is not adaptive method!");
+```
+
+##### 2.2.3.2 获取 URL 数据
+
+前面说过方法代理逻辑会从 URL 中提取目标拓展的名称,因此代码生成逻辑的一个重要的任务是从方法的参数列表或者其他参数中获取 URL 数据。举例说明一下,我们要为 Protocol 接口的 refer 和 export 方法生成代理逻辑。在运行时,通过反射得到的方法定义大致如下:
+
+```java
+Invoker refer(Class<T> arg0, URL arg1) throws RpcException;
+Exporter export(Invoker<T> arg0) throws RpcException;
+```
+
+对于 refer 方法,通过遍历 refer 的参数列表即可获取 URL 数据,这个还比较简单。对于 export 方法,获取 URL 数据则要麻烦一些。export 参数列表中没有 URL 参数,因此需要从 Invoker 参数中获取 URL 数据。获取方式是调用 Invoker 中可返回 URL 的 getter 方法,比如 getUrl。如果 Invoker 中无相关 getter 方法,此时则会抛出异常。整个逻辑如下:
+
+```java
+for (Method method : methods) {
+ Class<?> rt = method.getReturnType();
+ Class<?>[] pts = method.getParameterTypes();
+ Class<?>[] ets = method.getExceptionTypes();
+
+ Adaptive adaptiveAnnotation = method.getAnnotation(Adaptive.class);
+ StringBuilder code = new StringBuilder(512);
+ if (adaptiveAnnotation == null) {
+ // ${无 Adaptive 注解方法代码生成逻辑}
+ } else {
+ int urlTypeIndex = -1;
+ // 遍历参数列表,确定 URL 参数位置
+ for (int i = 0; i < pts.length; ++i) {
+ if (pts[i].equals(URL.class)) {
+ urlTypeIndex = i;
+ break;
+ }
+ }
+
+ // urlTypeIndex != -1,表示参数列表中存在 URL 参数
+ if (urlTypeIndex != -1) {
+ // 为 URL 类型参数生成判空代码,格式如下:
+ // if (arg + urlTypeIndex == null)
+ // throw new IllegalArgumentException("url == null");
+ String s = String.format("\nif (arg%d == null) throw new IllegalArgumentException(\"url == null\");",
+ urlTypeIndex);
+ code.append(s);
+
+ // 为 URL 类型参数生成赋值代码,形如 URL url = arg1
+ s = String.format("\n%s url = arg%d;", URL.class.getName(), urlTypeIndex);
+ code.append(s);
+
+ // 参数列表中不存在 URL 类型参数
+ } else {
+ String attribMethod = null;
+
+ LBL_PTS:
+ // 遍历方法的参数类型列表
+ for (int i = 0; i < pts.length; ++i) {
+ // 获取某一类型参数的全部方法
+ Method[] ms = pts[i].getMethods();
+ // 遍历方法列表,寻找可返回 URL 的 getter 方法
+ for (Method m : ms) {
+ String name = m.getName();
+ // 1. 方法名以 get 开头,或方法名大于3个字符
+ // 2. 方法的访问权限为 public
+ // 3. 非静态方法
+ // 4. 方法参数数量为0
+ // 5. 方法返回值类型为 URL
+ if ((name.startsWith("get") || name.length() > 3)
+ && Modifier.isPublic(m.getModifiers())
+ && !Modifier.isStatic(m.getModifiers())
+ && m.getParameterTypes().length == 0
+ && m.getReturnType() == URL.class) {
+ urlTypeIndex = i;
+ attribMethod = name;
+
+ // 结束 for (int i = 0; i < pts.length; ++i) 循环
+ break LBL_PTS;
+ }
+ }
+ }
+ if (attribMethod == null) {
+ // 如果所有参数中均不包含可返回 URL 的 getter 方法,则抛出异常
+ throw new IllegalStateException("fail to create adaptive class for interface ...");
+ }
+
+ // 为可返回 URL 的参数生成判空代码,格式如下:
+ // if (arg + urlTypeIndex == null)
+ // throw new IllegalArgumentException("参数全限定名 + argument == null");
+ String s = String.format("\nif (arg%d == null) throw new IllegalArgumentException(\"%s argument == null\");",
+ urlTypeIndex, pts[urlTypeIndex].getName());
+ code.append(s);
+
+ // 为 getter 方法返回的 URL 生成判空代码,格式如下:
+ // if (argN.getter方法名() == null)
+ // throw new IllegalArgumentException(参数全限定名 + argument getUrl() == null);
+ s = String.format("\nif (arg%d.%s() == null) throw new IllegalArgumentException(\"%s argument %s() == null\");",
+ urlTypeIndex, attribMethod, pts[urlTypeIndex].getName(), attribMethod);
+ code.append(s);
+
+ // 生成赋值语句,格式如下:
+ // URL全限定名 url = argN.getter方法名(),比如
+ // com.alibaba.dubbo.common.URL url = invoker.getUrl();
+ s = String.format("%s url = arg%d.%s();", URL.class.getName(), urlTypeIndex, attribMethod);
+ code.append(s);
+ }
+
+ // 省略无关代码
+ }
+
+ // 省略无关代码
+}
+```
+
+上面代码有点多,需要耐心看一下。这段代码主要目的是为了获取 URL 数据,并为之生成判空和赋值代码。以 Protocol 的 refer 和 export 方法为例,上面的代码为它们生成如下内容(代码已格式化):
+
+```java
+refer:
+if (arg1 == null)
+ throw new IllegalArgumentException("url == null");
+com.alibaba.dubbo.common.URL url = arg1;
+
+export:
+if (arg0 == null)
+ throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument == null");
+if (arg0.getUrl() == null)
+ throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument getUrl() == null");
+com.alibaba.dubbo.common.URL url = arg0.getUrl();
+```
+
+##### 2.2.3.3 获取 Adaptive 注解值
+
+Adaptive 注解值 value 类型为 String[],可填写多个值,默认情况下为空数组。若 value 为非空数组,直接获取数组内容即可。若 value 为空数组,则需进行额外处理。处理过程是将类名转换为字符数组,然后遍历字符数组,并将字符放入 StringBuilder 中。若字符为大写字母,则向 StringBuilder 中添加点号,随后将字符变为小写存入 StringBuilder 中。比如 LoadBalance 经过处理后,得到 load.balance。
+
+```java
+for (Method method : methods) {
+ Class<?> rt = method.getReturnType();
+ Class<?>[] pts = method.getParameterTypes();
+ Class<?>[] ets = method.getExceptionTypes();
+
+ Adaptive adaptiveAnnotation = method.getAnnotation(Adaptive.class);
+ StringBuilder code = new StringBuilder(512);
+ if (adaptiveAnnotation == null) {
+ // ${无 Adaptive 注解方法代码生成逻辑}
+ } else {
+ // ${获取 URL 数据}
+
+ String[] value = adaptiveAnnotation.value();
+ // value 为空数组
+ if (value.length == 0) {
+ // 获取类名,并将类名转换为字符数组
+ char[] charArray = type.getSimpleName().toCharArray();
+ StringBuilder sb = new StringBuilder(128);
+ // 遍历字节数组
+ for (int i = 0; i < charArray.length; i++) {
+ // 检测当前字符是否为大写字母
+ if (Character.isUpperCase(charArray[i])) {
+ if (i != 0) {
+ // 向 sb 中添加点号
+ sb.append(".");
+ }
+ // 将字符变为小写,并添加到 sb 中
+ sb.append(Character.toLowerCase(charArray[i]));
+ } else {
+ // 添加字符到 sb 中
+ sb.append(charArray[i]);
+ }
+ }
+ value = new String[]{sb.toString()};
+ }
+
+ // 省略无关代码
+ }
+
+ // 省略无关逻辑
+}
+```
+
+##### 2.2.3.4 检测 Invocation 参数
+
+此段逻辑是检测方法列表中是否存在 Invocation 类型的参数,若存在,则为其生成判空代码和其他一些代码。相应的逻辑如下:
+
+```java
+for (Method method : methods) {
+ Class<?> rt = method.getReturnType();
+ Class<?>[] pts = method.getParameterTypes(); // 获取参数类型列表
+ Class<?>[] ets = method.getExceptionTypes();
+
+ Adaptive adaptiveAnnotation = method.getAnnotation(Adaptive.class);
+ StringBuilder code = new StringBuilder(512);
+ if (adaptiveAnnotation == null) {
+ // ${无 Adaptive 注解方法代码生成逻辑}
+ } else {
+ // ${获取 URL 数据}
+
+ // ${获取 Adaptive 注解值}
+
+ boolean hasInvocation = false;
+ // 遍历参数类型列表
+ for (int i = 0; i < pts.length; ++i) {
+ // 判断当前参数名称是否等于 com.alibaba.dubbo.rpc.Invocation
+ if (pts[i].getName().equals("com.alibaba.dubbo.rpc.Invocation")) {
+ // 为 Invocation 类型参数生成判空代码
+ String s = String.format("\nif (arg%d == null) throw new IllegalArgumentException(\"invocation == null\");", i);
+ code.append(s);
+ // 生成 getMethodName 方法调用代码,格式为:
+ // String methodName = argN.getMethodName();
+ s = String.format("\nString methodName = arg%d.getMethodName();", i);
+ code.append(s);
+
+ // 设置 hasInvocation 为 true
+ hasInvocation = true;
+ break;
+ }
+ }
+ }
+
+ // 省略无关逻辑
+}
+```
+
+##### 2.2.3.5 生成拓展名获取逻辑
+
+本段逻辑用于根据 SPI 和 Adaptive 注解值生成“获取拓展名逻辑”,同时生成逻辑也受 Invocation 类型参数影响,综合因素导致本段逻辑相对复杂。本段逻辑可以会生成但不限于下面的代码:
+
+```java
+String extName = (url.getProtocol() == null ? "dubbo" : url.getProtocol());
+```
+
+或
+
+```java
+String extName = url.getMethodParameter(methodName, "loadbalance", "random");
+```
+
+亦或是
+
+```java
+String extName = url.getParameter("client", url.getParameter("transporter", "netty"));
+```
+
+本段逻辑复杂之处在于条件分支比较多,大家在阅读源码时需要知道每个条件分支的意义是什么,否则不太容易看懂相关代码。下面开始分析本段逻辑。
+
+```java
+for (Method method : methods) {
+ Class<?> rt = method.getReturnType();
+ Class<?>[] pts = method.getParameterTypes();
+ Class<?>[] ets = method.getExceptionTypes();
+
+ Adaptive adaptiveAnnotation = method.getAnnotation(Adaptive.class);
+ StringBuilder code = new StringBuilder(512);
+ if (adaptiveAnnotation == null) {
+ // $无 Adaptive 注解方法代码生成逻辑}
+ } else {
+ // ${获取 URL 数据}
+
+ // ${获取 Adaptive 注解值}
+
+ // ${检测 Invocation 参数}
+
+ // 设置默认拓展名,cachedDefaultName 源于 SPI 注解值,默认情况下,
+ // SPI 注解值为空串,此时 cachedDefaultName = null
+ String defaultExtName = cachedDefaultName;
+ String getNameCode = null;
+
+ // 遍历 value,这里的 value 是 Adaptive 的注解值,2.2.3.3 节分析过 value 变量的获取过程。
+ // 此处循环目的是生成从 URL 中获取拓展名的代码,生成的代码会赋值给 getNameCode 变量。注意这
+ // 个循环的遍历顺序是由后向前遍历的。
+ for (int i = value.length - 1; i >= 0; --i) {
+ // 当 i 为最后一个元素的坐标时
+ if (i == value.length - 1) {
+ // 默认拓展名非空
+ if (null != defaultExtName) {
+ // protocol 是 url 的一部分,可通过 getProtocol 方法获取,其他的则是从
+ // URL 参数中获取。因为获取方式不同,所以这里要判断 value[i] 是否为 protocol
+ if (!"protocol".equals(value[i]))
+ // hasInvocation 用于标识方法参数列表中是否有 Invocation 类型参数
+ if (hasInvocation)
+ // 生成的代码功能等价于下面的代码:
+ // url.getMethodParameter(methodName, value[i], defaultExtName)
+ // 以 LoadBalance 接口的 select 方法为例,最终生成的代码如下:
+ // url.getMethodParameter(methodName, "loadbalance", "random")
+ getNameCode = String.format("url.getMethodParameter(methodName, \"%s\", \"%s\")", value[i], defaultExtName);
+ else
+ // 生成的代码功能等价于下面的代码:
+ // url.getParameter(value[i], defaultExtName)
+ getNameCode = String.format("url.getParameter(\"%s\", \"%s\")", value[i], defaultExtName);
+ else
+ // 生成的代码功能等价于下面的代码:
+ // ( url.getProtocol() == null ? defaultExtName : url.getProtocol() )
+ getNameCode = String.format("( url.getProtocol() == null ? \"%s\" : url.getProtocol() )", defaultExtName);
+
+ // 默认拓展名为空
+ } else {
+ if (!"protocol".equals(value[i]))
+ if (hasInvocation)
+ // 生成代码格式同上
+ getNameCode = String.format("url.getMethodParameter(methodName, \"%s\", \"%s\")", value[i], defaultExtName);
+ else
+ // 生成的代码功能等价于下面的代码:
+ // url.getParameter(value[i])
+ getNameCode = String.format("url.getParameter(\"%s\")", value[i]);
+ else
+ // 生成从 url 中获取协议的代码,比如 "dubbo"
+ getNameCode = "url.getProtocol()";
+ }
+ } else {
+ if (!"protocol".equals(value[i]))
+ if (hasInvocation)
+ // 生成代码格式同上
+ getNameCode = String.format("url.getMethodParameter(methodName, \"%s\", \"%s\")", value[i], defaultExtName);
+ else
+ // 生成的代码功能等价于下面的代码:
+ // url.getParameter(value[i], getNameCode)
+ // 以 Transporter 接口的 connect 方法为例,最终生成的代码如下:
+ // url.getParameter("client", url.getParameter("transporter", "netty"))
+ getNameCode = String.format("url.getParameter(\"%s\", %s)", value[i], getNameCode);
+ else
+ // 生成的代码功能等价于下面的代码:
+ // url.getProtocol() == null ? getNameCode : url.getProtocol()
+ // 以 Protocol 接口的 connect 方法为例,最终生成的代码如下:
+ // url.getProtocol() == null ? "dubbo" : url.getProtocol()
+ getNameCode = String.format("url.getProtocol() == null ? (%s) : url.getProtocol()", getNameCode);
+ }
+ }
+ // 生成 extName 赋值代码
+ code.append("\nString extName = ").append(getNameCode).append(";");
+ // 生成 extName 判空代码
+ String s = String.format("\nif(extName == null) " +
+ "throw new IllegalStateException(\"Fail to get extension(%s) name from url(\" + url.toString() + \") use keys(%s)\");",
+ type.getName(), Arrays.toString(value));
+ code.append(s);
+ }
+
+ // 省略无关逻辑
+}
+```
+
+上面代码比较复杂,不是很好理解。对于这段代码,建议大家写点测试用例,对 Protocol、LoadBalance 以及 Transporter 等接口的自适应拓展类代码生成过程进行调试。这里我以 Transporter 接口的自适应拓展类代码生成过程举例说明。首先看一下 Transporter 接口的定义,如下:
+
+```java
+@SPI("netty")
+public interface Transporter {
+ // @Adaptive({server, transporter})
+ @Adaptive({Constants.SERVER_KEY, Constants.TRANSPORTER_KEY})
+ Server bind(URL url, ChannelHandler handler) throws RemotingException;
+
+ // @Adaptive({client, transporter})
+ @Adaptive({Constants.CLIENT_KEY, Constants.TRANSPORTER_KEY})
+ Client connect(URL url, ChannelHandler handler) throws RemotingException;
+}
+```
+
+下面对 connect 方法代理逻辑生成的过程进行分析,此时生成代理逻辑所用到的变量如下:
+
+```java
+String defaultExtName = "netty";
+boolean hasInvocation = false;
+String getNameCode = null;
+String[] value = ["client", "transporter"];
+```
+
+下面对 value 数组进行遍历,此时 i = 1, value[i] = "transporter",生成的代码如下:
+
+```java
+getNameCode = url.getParameter("transporter", "netty");
+```
+
+接下来,for 循环继续执行,此时 i = 0, value[i] = "client",生成的代码如下:
+
+```java
+getNameCode = url.getParameter("client", url.getParameter("transporter", "netty"));
+```
+
+for 循环结束运行,现在为 extName 变量生成赋值和判空代码,如下:
+
+```java
+String extName = url.getParameter("client", url.getParameter("transporter", "netty"));
+if (extName == null) {
+ throw new IllegalStateException(
+ "Fail to get extension(com.alibaba.dubbo.remoting.Transporter) name from url(" + url.toString()
+ + ") use keys([client, transporter])");
+}
+```
+
+##### 2.2.3.6 生成拓展加载与目标方法调用逻辑
+
+本段代码逻辑用于根据拓展名加载拓展实例,并调用拓展实例的目标方法。相关逻辑如下:
+
+```java
+for (Method method : methods) {
+ Class<?> rt = method.getReturnType();
+ Class<?>[] pts = method.getParameterTypes();
+ Class<?>[] ets = method.getExceptionTypes();
+
+ Adaptive adaptiveAnnotation = method.getAnnotation(Adaptive.class);
+ StringBuilder code = new StringBuilder(512);
+ if (adaptiveAnnotation == null) {
+ // $无 Adaptive 注解方法代码生成逻辑}
+ } else {
+ // ${获取 URL 数据}
+
+ // ${获取 Adaptive 注解值}
+
+ // ${检测 Invocation 参数}
+
+ // ${生成拓展名获取逻辑}
+
+ // 生成拓展获取代码,格式如下:
+ // type全限定名 extension = (type全限定名)ExtensionLoader全限定名
+ // .getExtensionLoader(type全限定名.class).getExtension(extName);
+ // Tips: 格式化字符串中的 %<s 表示使用前一个转换符所描述的参数,即 type 全限定名
+ s = String.format("\n%s extension = (%<s)%s.getExtensionLoader(%s.class).getExtension(extName);",
+ type.getName(), ExtensionLoader.class.getSimpleName(), type.getName());
+ code.append(s);
+
+ // 如果方法返回值类型非 void,则生成 return 语句。
+ if (!rt.equals(void.class)) {
+ code.append("\nreturn ");
+ }
+
+ // 生成目标方法调用逻辑,格式为:
+ // extension.方法名(arg0, arg2, ..., argN);
+ s = String.format("extension.%s(", method.getName());
+ code.append(s);
+ for (int i = 0; i < pts.length; i++) {
+ if (i != 0)
+ code.append(", ");
+ code.append("arg").append(i);
+ }
+ code.append(");");
+ }
+
+ // 省略无关逻辑
+}
+```
+
+以 Protocol 接口举例说明,上面代码生成的内容如下:
+
+```java
+com.alibaba.dubbo.rpc.Protocol extension = (com.alibaba.dubbo.rpc.Protocol) ExtensionLoader
+ .getExtensionLoader(com.alibaba.dubbo.rpc.Protocol.class).getExtension(extName);
+return extension.refer(arg0, arg1);
+```
+
+##### 2.2.3.7 生成完整的方法
+
+本节进行代码生成的收尾工作,主要用于生成方法定义的代码。相关逻辑如下:
+
+```java
+for (Method method : methods) {
+ Class<?> rt = method.getReturnType();
+ Class<?>[] pts = method.getParameterTypes();
+ Class<?>[] ets = method.getExceptionTypes();
+
+ Adaptive adaptiveAnnotation = method.getAnnotation(Adaptive.class);
+ StringBuilder code = new StringBuilder(512);
+ if (adaptiveAnnotation == null) {
+ // $无 Adaptive 注解方法代码生成逻辑}
+ } else {
+ // ${获取 URL 数据}
+
+ // ${获取 Adaptive 注解值}
+
+ // ${检测 Invocation 参数}
+
+ // ${生成拓展名获取逻辑}
+
+ // ${生成拓展加载与目标方法调用逻辑}
+ }
+}
+
+// public + 返回值全限定名 + 方法名 + (
+codeBuilder.append("\npublic ")
+ .append(rt.getCanonicalName())
+ .append(" ")
+ .append(method.getName())
+ .append("(");
+
+// 添加参数列表代码
+for (int i = 0; i < pts.length; i++) {
+ if (i > 0) {
+ codeBuilder.append(", ");
+ }
+ codeBuilder.append(pts[i].getCanonicalName());
+ codeBuilder.append(" ");
+ codeBuilder.append("arg").append(i);
+}
+codeBuilder.append(")");
+
+// 添加异常抛出代码
+if (ets.length > 0) {
+ codeBuilder.append(" throws ");
+ for (int i = 0; i < ets.length; i++) {
+ if (i > 0) {
+ codeBuilder.append(", ");
+ }
+ codeBuilder.append(ets[i].getCanonicalName());
+ }
+}
+codeBuilder.append(" {");
+codeBuilder.append(code.toString());
+codeBuilder.append("\n}");
+```
+
+以 Protocol 的 refer 方法为例,上面代码生成的内容如下:
+
+```java
+public com.alibaba.dubbo.rpc.Invoker refer(java.lang.Class arg0, com.alibaba.dubbo.common.URL arg1) {
+ // 方法体
+}
+```
+
+## 3.总结
+
+到此,关于自适应拓展的原理,实现就分析完了。总的来说自适应拓展整个逻辑还是很复杂的,并不是很容易弄懂。因此,大家在阅读该部分源码时,耐心一些。同时多进行调试,也可以通过生成好的代码思考代码的生成逻辑。好了,本篇文章就分析到这里。
\ No newline at end of file
diff --git a/doc-archive/v2.7.3/docs/zh-cn/source_code_guide/cluster.md b/doc-archive/v2.7.3/docs/zh-cn/source_code_guide/cluster.md
new file mode 100644
index 0000000..36ebb4e
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/source_code_guide/cluster.md
@@ -0,0 +1,606 @@
+---
+title: 集群
+keywords: Dubbo, Cluster
+description: 本文介绍了集群的原理和实现细节
+---
+
+## 1.简介
+
+为了避免单点故障,现在的应用通常至少会部署在两台服务器上。对于一些负载比较高的服务,会部署更多的服务器。这样,在同一环境下的服务提供者数量会大于1。对于服务消费者来说,同一环境下出现了多个服务提供者。这时会出现一个问题,服务消费者需要决定选择哪个服务提供者进行调用。另外服务调用失败时的处理措施也是需要考虑的,是重试呢,还是抛出异常,亦或是只打印异常等。为了处理这些问题,Dubbo 定义了集群接口 Cluster 以及 Cluster Invoker。集群 Cluster 用途是将多个服务提供者合并为一个 Cluster Invoker,并将这个 Invoker 暴露给服务消费者。这样一来,服务消费者只需通过这个 Invoker 进行远程调用即可,至于具体调用哪个服务提供者,以及调用失败后如何处理等问题,现在都交给集群模块去处理。集群模块是服务提供者和服务�
��费者的中间层,为服务消费者屏蔽了服务提供者的情况,这样服务消费者就可以专心处理远程调用相关事宜。比如发请求,接受服务提供者返回的数据等。这就是集群的作用。
+
+Dubbo 提供了多种集群实现,包含但不限于 Failover Cluster、Failfast Cluster 和 Failsafe Cluster 等。每种集群实现类的用途不同,接下来会一一进行分析。
+
+## 2. 集群容错
+
+在对集群相关代码进行分析之前,这里有必要先来介绍一下集群容错的所有组件。包含 Cluster、Cluster Invoker、Directory、Router 和 LoadBalance 等。
+
+
+
+集群工作过程可分为两个阶段,第一个阶段是在服务消费者初始化期间,集群 Cluster 实现类为服务消费者创建 Cluster Invoker 实例,即上图中的 merge 操作。第二个阶段是在服务消费者进行远程调用时。以 FailoverClusterInvoker 为例,该类型 Cluster Invoker 首先会调用 Directory 的 list 方法列举 Invoker 列表(可将 Invoker 简单理解为服务提供者)。Directory 的用途是保存 Invoker,可简单类比为 List\<Invoker\>。其实现类 RegistryDirectory 是一个动态服务目录,可感知注册中心配置的变化,它所持有的 Invoker 列表会随着注册中心内容的变化而变化。每次变化后,RegistryDirectory 会动态增删 Invoker,并调用 Router 的 route 方法进行路由,过滤掉不符合路由规则的 Invoker。当 FailoverClusterInvoker 拿到 Directory 返回的 Invoker 列表后,它会通过 Load [...]
+
+以上就是集群工作的整个流程,这里并没介绍集群是如何容错的。Dubbo 主要提供了这样几种容错方式:
+
+- Failover Cluster - 失败自动切换
+- Failfast Cluster - 快速失败
+- Failsafe Cluster - 失败安全
+- Failback Cluster - 失败自动恢复
+- Forking Cluster - 并行调用多个服务提供者
+
+下面开始分析源码。
+
+## 3.源码分析
+
+### 3.1 Cluster 实现类分析
+
+我们在上一章看到了两个概念,分别是集群接口 Cluster 和 Cluster Invoker,这两者是不同的。Cluster 是接口,而 Cluster Invoker 是一种 Invoker。服务提供者的选择逻辑,以及远程调用失败后的的处理逻辑均是封装在 Cluster Invoker 中。那么 Cluster 接口和相关实现类有什么用呢?用途比较简单,仅用于生成 Cluster Invoker。下面我们来看一下源码。
+
+```java
+public class FailoverCluster implements Cluster {
+
+ public final static String NAME = "failover";
+
+ @Override
+ public <T> Invoker<T> join(Directory<T> directory) throws RpcException {
+ // 创建并返回 FailoverClusterInvoker 对象
+ return new FailoverClusterInvoker<T>(directory);
+ }
+}
+```
+
+如上,FailoverCluster 总共就包含这几行代码,用于创建 FailoverClusterInvoker 对象,很简单。下面再看一个。
+
+```java
+public class FailbackCluster implements Cluster {
+
+ public final static String NAME = "failback";
+
+ @Override
+ public <T> Invoker<T> join(Directory<T> directory) throws RpcException {
+ // 创建并返回 FailbackClusterInvoker 对象
+ return new FailbackClusterInvoker<T>(directory);
+ }
+
+}
+```
+
+如上,FailbackCluster 的逻辑也是很简单,无需解释了。所以接下来,我们把重点放在各种 Cluster Invoker 上
+
+### 3.2 Cluster Invoker 分析
+
+我们首先从各种 Cluster Invoker 的父类 AbstractClusterInvoker 源码开始说起。前面说过,集群工作过程可分为两个阶段,第一个阶段是在服务消费者初始化期间,这个在[服务引用]()那篇文章中分析过,就不赘述。第二个阶段是在服务消费者进行远程调用时,此时 AbstractClusterInvoker 的 invoke 方法会被调用。列举 Invoker,负载均衡等操作均会在此阶段被执行。因此下面先来看一下 invoke 方法的逻辑。
+
+```java
+public Result invoke(final Invocation invocation) throws RpcException {
+ checkWhetherDestroyed();
+ LoadBalance loadbalance = null;
+
+ // 绑定 attachments 到 invocation 中.
+ Map<String, String> contextAttachments = RpcContext.getContext().getAttachments();
+ if (contextAttachments != null && contextAttachments.size() != 0) {
+ ((RpcInvocation) invocation).addAttachments(contextAttachments);
+ }
+
+ // 列举 Invoker
+ List<Invoker<T>> invokers = list(invocation);
+ if (invokers != null && !invokers.isEmpty()) {
+ // 加载 LoadBalance
+ loadbalance = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(invokers.get(0).getUrl()
+ .getMethodParameter(RpcUtils.getMethodName(invocation), Constants.LOADBALANCE_KEY, Constants.DEFAULT_LOADBALANCE));
+ }
+ RpcUtils.attachInvocationIdIfAsync(getUrl(), invocation);
+
+ // 调用 doInvoke 进行后续操作
+ return doInvoke(invocation, invokers, loadbalance);
+}
+
+// 抽象方法,由子类实现
+protected abstract Result doInvoke(Invocation invocation, List<Invoker<T>> invokers,
+ LoadBalance loadbalance) throws RpcException;
+```
+
+AbstractClusterInvoker 的 invoke 方法主要用于列举 Invoker,以及加载 LoadBalance。最后再调用模板方法 doInvoke 进行后续操作。下面我们来看一下 Invoker 列举方法 list(Invocation) 的逻辑,如下:
+
+```java
+protected List<Invoker<T>> list(Invocation invocation) throws RpcException {
+ // 调用 Directory 的 list 方法列举 Invoker
+ List<Invoker<T>> invokers = directory.list(invocation);
+ return invokers;
+}
+```
+
+如上,AbstractClusterInvoker 中的 list 方法做的事情很简单,只是简单的调用了 Directory 的 list 方法,没有其他更多的逻辑了。Directory 即相关实现类在前文已经分析过,这里就不多说了。接下来,我们把目光转移到 AbstractClusterInvoker 的各种实现类上,来看一下这些实现类是如何实现 doInvoke 方法逻辑的。
+
+#### 3.2.1 FailoverClusterInvoker
+
+FailoverClusterInvoker 在调用失败时,会自动切换 Invoker 进行重试。默认确配置下,Dubbo 会使用这个类作为缺省 Cluster Invoker。下面来看一下该类的逻辑。
+
+```java
+public class FailoverClusterInvoker<T> extends AbstractClusterInvoker<T> {
+
+ // 省略部分代码
+
+ @Override
+ public Result doInvoke(Invocation invocation, final List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
+ List<Invoker<T>> copyinvokers = invokers;
+ checkInvokers(copyinvokers, invocation);
+ // 获取重试次数
+ int len = getUrl().getMethodParameter(invocation.getMethodName(), Constants.RETRIES_KEY, Constants.DEFAULT_RETRIES) + 1;
+ if (len <= 0) {
+ len = 1;
+ }
+ RpcException le = null;
+ List<Invoker<T>> invoked = new ArrayList<Invoker<T>>(copyinvokers.size());
+ Set<String> providers = new HashSet<String>(len);
+ // 循环调用,失败重试
+ for (int i = 0; i < len; i++) {
+ if (i > 0) {
+ checkWhetherDestroyed();
+ // 在进行重试前重新列举 Invoker,这样做的好处是,如果某个服务挂了,
+ // 通过调用 list 可得到最新可用的 Invoker 列表
+ copyinvokers = list(invocation);
+ // 对 copyinvokers 进行判空检查
+ checkInvokers(copyinvokers, invocation);
+ }
+
+ // 通过负载均衡选择 Invoker
+ Invoker<T> invoker = select(loadbalance, invocation, copyinvokers, invoked);
+ // 添加到 invoker 到 invoked 列表中
+ invoked.add(invoker);
+ // 设置 invoked 到 RPC 上下文中
+ RpcContext.getContext().setInvokers((List) invoked);
+ try {
+ // 调用目标 Invoker 的 invoke 方法
+ Result result = invoker.invoke(invocation);
+ return result;
+ } catch (RpcException e) {
+ if (e.isBiz()) {
+ throw e;
+ }
+ le = e;
+ } catch (Throwable e) {
+ le = new RpcException(e.getMessage(), e);
+ } finally {
+ providers.add(invoker.getUrl().getAddress());
+ }
+ }
+
+ // 若重试失败,则抛出异常
+ throw new RpcException(..., "Failed to invoke the method ...");
+ }
+}
+```
+
+如上,FailoverClusterInvoker 的 doInvoke 方法首先是获取重试次数,然后根据重试次数进行循环调用,失败后进行重试。在 for 循环内,首先是通过负载均衡组件选择一个 Invoker,然后再通过这个 Invoker 的 invoke 方法进行远程调用。如果失败了,记录下异常,并进行重试。重试时会再次调用父类的 list 方法列举 Invoker。整个流程大致如此,不是很难理解。下面我们看一下 select 方法的逻辑。
+
+
+```java
+protected Invoker<T> select(LoadBalance loadbalance, Invocation invocation, List<Invoker<T>> invokers, List<Invoker<T>> selected) throws RpcException {
+ if (invokers == null || invokers.isEmpty())
+ return null;
+ // 获取调用方法名
+ String methodName = invocation == null ? "" : invocation.getMethodName();
+
+ // 获取 sticky 配置,sticky 表示粘滞连接。所谓粘滞连接是指让服务消费者尽可能的
+ // 调用同一个服务提供者,除非该提供者挂了再进行切换
+ boolean sticky = invokers.get(0).getUrl().getMethodParameter(methodName, Constants.CLUSTER_STICKY_KEY, Constants.DEFAULT_CLUSTER_STICKY);
+ {
+ // 检测 invokers 列表是否包含 stickyInvoker,如果不包含,
+ // 说明 stickyInvoker 代表的服务提供者挂了,此时需要将其置空
+ if (stickyInvoker != null && !invokers.contains(stickyInvoker)) {
+ stickyInvoker = null;
+ }
+
+ // 在 sticky 为 true,且 stickyInvoker != null 的情况下。如果 selected 包含
+ // stickyInvoker,表明 stickyInvoker 对应的服务提供者可能因网络原因未能成功提供服务。
+ // 但是该提供者并没挂,此时 invokers 列表中仍存在该服务提供者对应的 Invoker。
+ if (sticky && stickyInvoker != null && (selected == null || !selected.contains(stickyInvoker))) {
+ // availablecheck 表示是否开启了可用性检查,如果开启了,则调用 stickyInvoker 的
+ // isAvailable 方法进行检查,如果检查通过,则直接返回 stickyInvoker。
+ if (availablecheck && stickyInvoker.isAvailable()) {
+ return stickyInvoker;
+ }
+ }
+ }
+
+ // 如果线程走到当前代码处,说明前面的 stickyInvoker 为空,或者不可用。
+ // 此时继续调用 doSelect 选择 Invoker
+ Invoker<T> invoker = doSelect(loadbalance, invocation, invokers, selected);
+
+ // 如果 sticky 为 true,则将负载均衡组件选出的 Invoker 赋值给 stickyInvoker
+ if (sticky) {
+ stickyInvoker = invoker;
+ }
+ return invoker;
+}
+```
+
+如上,select 方法的主要逻辑集中在了对粘滞连接特性的支持上。首先是获取 sticky 配置,然后再检测 invokers 列表中是否包含 stickyInvoker,如果不包含,则认为该 stickyInvoker 不可用,此时将其置空。这里的 invokers 列表可以看做是**存活着的服务提供者**列表,如果这个列表不包含 stickyInvoker,那自然而然的认为 stickyInvoker 挂了,所以置空。如果 stickyInvoker 存在于 invokers 列表中,此时要进行下一项检测 — 检测 selected 中是否包含 stickyInvoker。如果包含的话,说明 stickyInvoker 在此之前没有成功提供服务(但其仍然处于存活状态)。此时我们认为这个服务不可靠,不应该在重试期间内再次被调用,因此这个时候不会返回该 stickyInvoker。如果 selected 不包含 stickyInvoker,此时还需要进行可用性检测,比如检测服务提供者网络连通性等。当可用性检测通过,才可�
��回 stickyInvoker,否则调用 doSe [...]
+
+以上就是 select 方法的逻辑,这段逻辑看起来不是很复杂,但是信息量比较大。不搞懂 invokers 和 selected 两个入参的含义,以及粘滞连接特性,这段代码是不容易看懂的。所以大家在阅读这段代码时,不要忽略了对背景知识的理解。关于 select 方法先分析这么多,继续向下分析。
+
+
+```java
+private Invoker<T> doSelect(LoadBalance loadbalance, Invocation invocation, List<Invoker<T>> invokers, List<Invoker<T>> selected) throws RpcException {
+ if (invokers == null || invokers.isEmpty())
+ return null;
+ if (invokers.size() == 1)
+ return invokers.get(0);
+ if (loadbalance == null) {
+ // 如果 loadbalance 为空,这里通过 SPI 加载 Loadbalance,默认为 RandomLoadBalance
+ loadbalance = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(Constants.DEFAULT_LOADBALANCE);
+ }
+
+ // 通过负载均衡组件选择 Invoker
+ Invoker<T> invoker = loadbalance.select(invokers, getUrl(), invocation);
+
+ // 如果 selected 包含负载均衡选择出的 Invoker,或者该 Invoker 无法经过可用性检查,此时进行重选
+ if ((selected != null && selected.contains(invoker))
+ || (!invoker.isAvailable() && getUrl() != null && availablecheck)) {
+ try {
+ // 进行重选
+ Invoker<T> rinvoker = reselect(loadbalance, invocation, invokers, selected, availablecheck);
+ if (rinvoker != null) {
+ // 如果 rinvoker 不为空,则将其赋值给 invoker
+ invoker = rinvoker;
+ } else {
+ // rinvoker 为空,定位 invoker 在 invokers 中的位置
+ int index = invokers.indexOf(invoker);
+ try {
+ // 获取 index + 1 位置处的 Invoker,以下代码等价于:
+ // invoker = invokers.get((index + 1) % invokers.size());
+ invoker = index < invokers.size() - 1 ? invokers.get(index + 1) : invokers.get(0);
+ } catch (Exception e) {
+ logger.warn("... may because invokers list dynamic change, ignore.");
+ }
+ }
+ } catch (Throwable t) {
+ logger.error("cluster reselect fail reason is : ...");
+ }
+ }
+ return invoker;
+}
+```
+
+doSelect 主要做了两件事,第一是通过负载均衡组件选择 Invoker。第二是,如果选出来的 Invoker 不稳定,或不可用,此时需要调用 reselect 方法进行重选。若 reselect 选出来的 Invoker 为空,此时定位 invoker 在 invokers 列表中的位置 index,然后获取 index + 1 处的 invoker,这也可以看做是重选逻辑的一部分。下面我们来看一下 reselect 方法的逻辑。
+
+
+```java
+private Invoker<T> reselect(LoadBalance loadbalance, Invocation invocation,
+ List<Invoker<T>> invokers, List<Invoker<T>> selected, boolean availablecheck) throws RpcException {
+
+ List<Invoker<T>> reselectInvokers = new ArrayList<Invoker<T>>(invokers.size() > 1 ? (invokers.size() - 1) : invokers.size());
+
+ // 下面的 if-else 分支逻辑有些冗余,pull request #2826 对这段代码进行了简化,可以参考一下
+ // 根据 availablecheck 进行不同的处理
+ if (availablecheck) {
+ // 遍历 invokers 列表
+ for (Invoker<T> invoker : invokers) {
+ // 检测可用性
+ if (invoker.isAvailable()) {
+ // 如果 selected 列表不包含当前 invoker,则将其添加到 reselectInvokers 中
+ if (selected == null || !selected.contains(invoker)) {
+ reselectInvokers.add(invoker);
+ }
+ }
+ }
+
+ // reselectInvokers 不为空,此时通过负载均衡组件进行选择
+ if (!reselectInvokers.isEmpty()) {
+ return loadbalance.select(reselectInvokers, getUrl(), invocation);
+ }
+
+ // 不检查 Invoker 可用性
+ } else {
+ for (Invoker<T> invoker : invokers) {
+ // 如果 selected 列表不包含当前 invoker,则将其添加到 reselectInvokers 中
+ if (selected == null || !selected.contains(invoker)) {
+ reselectInvokers.add(invoker);
+ }
+ }
+ if (!reselectInvokers.isEmpty()) {
+ // 通过负载均衡组件进行选择
+ return loadbalance.select(reselectInvokers, getUrl(), invocation);
+ }
+ }
+
+ {
+ // 若线程走到此处,说明 reselectInvokers 集合为空,此时不会调用负载均衡组件进行筛选。
+ // 这里从 selected 列表中查找可用的 Invoker,并将其添加到 reselectInvokers 集合中
+ if (selected != null) {
+ for (Invoker<T> invoker : selected) {
+ if ((invoker.isAvailable())
+ && !reselectInvokers.contains(invoker)) {
+ reselectInvokers.add(invoker);
+ }
+ }
+ }
+ if (!reselectInvokers.isEmpty()) {
+ // 再次进行选择,并返回选择结果
+ return loadbalance.select(reselectInvokers, getUrl(), invocation);
+ }
+ }
+ return null;
+}
+```
+
+reselect 方法总结下来其实只做了两件事情,第一是查找可用的 Invoker,并将其添加到 reselectInvokers 集合中。第二,如果 reselectInvokers 不为空,则通过负载均衡组件再次进行选择。其中第一件事情又可进行细分,一开始,reselect 从 invokers 列表中查找有效可用的 Invoker,若未能找到,此时再到 selected 列表中继续查找。关于 reselect 方法就先分析到这,继续分析其他的 Cluster Invoker。
+
+#### 3.2.2 FailbackClusterInvoker
+
+FailbackClusterInvoker 会在调用失败后,返回一个空结果给服务提供者。并通过定时任务对失败的调用进行重传,适合执行消息通知等操作。下面来看一下它的实现逻辑。
+
+```java
+public class FailbackClusterInvoker<T> extends AbstractClusterInvoker<T> {
+
+ private static final long RETRY_FAILED_PERIOD = 5 * 1000;
+
+ private final ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(2,
+ new NamedInternalThreadFactory("failback-cluster-timer", true));
+
+ private final ConcurrentMap<Invocation, AbstractClusterInvoker<?>> failed = new ConcurrentHashMap<Invocation, AbstractClusterInvoker<?>>();
+ private volatile ScheduledFuture<?> retryFuture;
+
+ @Override
+ protected Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
+ try {
+ checkInvokers(invokers, invocation);
+ // 选择 Invoker
+ Invoker<T> invoker = select(loadbalance, invocation, invokers, null);
+ // 进行调用
+ return invoker.invoke(invocation);
+ } catch (Throwable e) {
+ // 如果调用过程中发生异常,此时仅打印错误日志,不抛出异常
+ logger.error("Failback to invoke method ...");
+
+ // 记录调用信息
+ addFailed(invocation, this);
+ // 返回一个空结果给服务消费者
+ return new RpcResult();
+ }
+ }
+
+ private void addFailed(Invocation invocation, AbstractClusterInvoker<?> router) {
+ if (retryFuture == null) {
+ synchronized (this) {
+ if (retryFuture == null) {
+ // 创建定时任务,每隔5秒执行一次
+ retryFuture = scheduledExecutorService.scheduleWithFixedDelay(new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ // 对失败的调用进行重试
+ retryFailed();
+ } catch (Throwable t) {
+ // 如果发生异常,仅打印异常日志,不抛出
+ logger.error("Unexpected error occur at collect statistic", t);
+ }
+ }
+ }, RETRY_FAILED_PERIOD, RETRY_FAILED_PERIOD, TimeUnit.MILLISECONDS);
+ }
+ }
+ }
+
+ // 添加 invocation 和 invoker 到 failed 中
+ failed.put(invocation, router);
+ }
+
+ void retryFailed() {
+ if (failed.size() == 0) {
+ return;
+ }
+
+ // 遍历 failed,对失败的调用进行重试
+ for (Map.Entry<Invocation, AbstractClusterInvoker<?>> entry : new HashMap<Invocation, AbstractClusterInvoker<?>>(failed).entrySet()) {
+ Invocation invocation = entry.getKey();
+ Invoker<?> invoker = entry.getValue();
+ try {
+ // 再次进行调用
+ invoker.invoke(invocation);
+ // 调用成功后,从 failed 中移除 invoker
+ failed.remove(invocation);
+ } catch (Throwable e) {
+ // 仅打印异常,不抛出
+ logger.error("Failed retry to invoke method ...");
+ }
+ }
+ }
+}
+```
+
+这个类主要由3个方法组成,首先是 doInvoker,该方法负责初次的远程调用。若远程调用失败,则通过 addFailed 方法将调用信息存入到 failed 中,等待定时重试。addFailed 在开始阶段会根据 retryFuture 为空与否,来决定是否开启定时任务。retryFailed 方法则是包含了失败重试的逻辑,该方法会对 failed 进行遍历,然后依次对 Invoker 进行调用。调用成功则将 Invoker 从 failed 中移除,调用失败则忽略失败原因。
+
+以上就是 FailbackClusterInvoker 的执行逻辑,不是很复杂,继续往下看。
+
+#### 3.2.3 FailfastClusterInvoker
+
+FailfastClusterInvoker 只会进行一次调用,失败后立即抛出异常。适用于幂等操作,比如新增记录。源码如下:
+
+```java
+public class FailfastClusterInvoker<T> extends AbstractClusterInvoker<T> {
+
+ @Override
+ public Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
+ checkInvokers(invokers, invocation);
+ // 选择 Invoker
+ Invoker<T> invoker = select(loadbalance, invocation, invokers, null);
+ try {
+ // 调用 Invoker
+ return invoker.invoke(invocation);
+ } catch (Throwable e) {
+ if (e instanceof RpcException && ((RpcException) e).isBiz()) {
+ // 抛出异常
+ throw (RpcException) e;
+ }
+ // 抛出异常
+ throw new RpcException(..., "Failfast invoke providers ...");
+ }
+ }
+}
+```
+
+如上,首先是通过 select 方法选择 Invoker,然后进行远程调用。如果调用失败,则立即抛出异常。FailfastClusterInvoker 就先分析到这,下面分析 FailsafeClusterInvoker。
+
+#### 3.2.4 FailsafeClusterInvoker
+
+FailsafeClusterInvoker 是一种失败安全的 Cluster Invoker。所谓的失败安全是指,当调用过程中出现异常时,FailsafeClusterInvoker 仅会打印异常,而不会抛出异常。适用于写入审计日志等操作。下面分析源码。
+
+```java
+public class FailsafeClusterInvoker<T> extends AbstractClusterInvoker<T> {
+
+ @Override
+ public Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
+ try {
+ checkInvokers(invokers, invocation);
+ // 选择 Invoker
+ Invoker<T> invoker = select(loadbalance, invocation, invokers, null);
+ // 进行远程调用
+ return invoker.invoke(invocation);
+ } catch (Throwable e) {
+ // 打印错误日志,但不抛出
+ logger.error("Failsafe ignore exception: " + e.getMessage(), e);
+ // 返回空结果忽略错误
+ return new RpcResult();
+ }
+ }
+}
+```
+
+FailsafeClusterInvoker 的逻辑和 FailfastClusterInvoker 的逻辑一样简单,无需过多说明。继续向下分析。
+
+#### 3.2.5 ForkingClusterInvoker
+
+ForkingClusterInvoker 会在运行时通过线程池创建多个线程,并发调用多个服务提供者。只要有一个服务提供者成功返回了结果,doInvoke 方法就会立即结束运行。ForkingClusterInvoker 的应用场景是在一些对实时性要求比较高**读操作**(注意是读操作,并行写操作可能不安全)下使用,但这将会耗费更多的资源。下面来看该类的实现。
+
+```java
+public class ForkingClusterInvoker<T> extends AbstractClusterInvoker<T> {
+
+ private final ExecutorService executor = Executors.newCachedThreadPool(
+ new NamedInternalThreadFactory("forking-cluster-timer", true));
+
+ @Override
+ public Result doInvoke(final Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
+ try {
+ checkInvokers(invokers, invocation);
+ final List<Invoker<T>> selected;
+ // 获取 forks 配置
+ final int forks = getUrl().getParameter(Constants.FORKS_KEY, Constants.DEFAULT_FORKS);
+ // 获取超时配置
+ final int timeout = getUrl().getParameter(Constants.TIMEOUT_KEY, Constants.DEFAULT_TIMEOUT);
+ // 如果 forks 配置不合理,则直接将 invokers 赋值给 selected
+ if (forks <= 0 || forks >= invokers.size()) {
+ selected = invokers;
+ } else {
+ selected = new ArrayList<Invoker<T>>();
+ // 循环选出 forks 个 Invoker,并添加到 selected 中
+ for (int i = 0; i < forks; i++) {
+ // 选择 Invoker
+ Invoker<T> invoker = select(loadbalance, invocation, invokers, selected);
+ if (!selected.contains(invoker)) {
+ selected.add(invoker);
+ }
+ }
+ }
+
+ // ----------------------✨ 分割线1 ✨---------------------- //
+
+ RpcContext.getContext().setInvokers((List) selected);
+ final AtomicInteger count = new AtomicInteger();
+ final BlockingQueue<Object> ref = new LinkedBlockingQueue<Object>();
+ // 遍历 selected 列表
+ for (final Invoker<T> invoker : selected) {
+ // 为每个 Invoker 创建一个执行线程
+ executor.execute(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ // 进行远程调用
+ Result result = invoker.invoke(invocation);
+ // 将结果存到阻塞队列中
+ ref.offer(result);
+ } catch (Throwable e) {
+ int value = count.incrementAndGet();
+ // 仅在 value 大于等于 selected.size() 时,才将异常对象
+ // 放入阻塞队列中,请大家思考一下为什么要这样做。
+ if (value >= selected.size()) {
+ // 将异常对象存入到阻塞队列中
+ ref.offer(e);
+ }
+ }
+ }
+ });
+ }
+
+ // ----------------------✨ 分割线2 ✨---------------------- //
+
+ try {
+ // 从阻塞队列中取出远程调用结果
+ Object ret = ref.poll(timeout, TimeUnit.MILLISECONDS);
+
+ // 如果结果类型为 Throwable,则抛出异常
+ if (ret instanceof Throwable) {
+ Throwable e = (Throwable) ret;
+ throw new RpcException(..., "Failed to forking invoke provider ...");
+ }
+
+ // 返回结果
+ return (Result) ret;
+ } catch (InterruptedException e) {
+ throw new RpcException("Failed to forking invoke provider ...");
+ }
+ } finally {
+ RpcContext.getContext().clearAttachments();
+ }
+ }
+}
+```
+
+ForkingClusterInvoker 的 doInvoker 方法比较长,这里通过两个分割线将整个方法划分为三个逻辑块。从方法开始到分割线1之间的代码主要是用于选出 forks 个 Invoker,为接下来的并发调用提供输入。分割线1和分割线2之间的逻辑通过线程池并发调用多个 Invoker,并将结果存储在阻塞队列中。分割线2到方法结尾之间的逻辑主要用于从阻塞队列中获取返回结果,并对返回结果类型进行判断。如果为异常类型,则直接抛出,否则返回。
+
+以上就是ForkingClusterInvoker 的 doInvoker 方法大致过程。我们在分割线1和分割线2之间的代码上留了一个问题,问题是这样的:为什么要在`value >= selected.size()`的情况下,才将异常对象添加到阻塞队列中?这里来解答一下。原因是这样的,在并行调用多个服务提供者的情况下,只要有一个服务提供者能够成功返回结果,而其他全部失败。此时 ForkingClusterInvoker 仍应该返回成功的结果,而非抛出异常。在`value >= selected.size()`时将异常对象放入阻塞队列中,可以保证异常对象不会出现在正常结果的前面,这样可从阻塞队列中优先取出正常的结果。
+
+关于 ForkingClusterInvoker 就先分析到这,接下来分析最后一个 Cluster Invoker。
+
+#### 3.2.6 BroadcastClusterInvoker
+
+本章的最后,我们再来看一下 BroadcastClusterInvoker。BroadcastClusterInvoker 会逐个调用每个服务提供者,如果其中一台报错,在循环调用结束后,BroadcastClusterInvoker 会抛出异常。该类通常用于通知所有提供者更新缓存或日志等本地资源信息。源码如下。
+
+```java
+public class BroadcastClusterInvoker<T> extends AbstractClusterInvoker<T> {
+
+ @Override
+ public Result doInvoke(final Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
+ checkInvokers(invokers, invocation);
+ RpcContext.getContext().setInvokers((List) invokers);
+ RpcException exception = null;
+ Result result = null;
+ // 遍历 Invoker 列表,逐个调用
+ for (Invoker<T> invoker : invokers) {
+ try {
+ // 进行远程调用
+ result = invoker.invoke(invocation);
+ } catch (RpcException e) {
+ exception = e;
+ logger.warn(e.getMessage(), e);
+ } catch (Throwable e) {
+ exception = new RpcException(e.getMessage(), e);
+ logger.warn(e.getMessage(), e);
+ }
+ }
+
+ // exception 不为空,则抛出异常
+ if (exception != null) {
+ throw exception;
+ }
+ return result;
+ }
+}
+```
+
+以上就是 BroadcastClusterInvoker 的代码,比较简单,就不多说了。
+
+## 4.总结
+
+本篇文章详细分析了集群容错的几种实现方式。集群容错对于 Dubbo 框架来说,是很重要的逻辑。集群模块处于服务提供者和消费者之间,对于服务消费者来说,集群可向其屏蔽服务提供者集群的情况,使其能够专心进行远程调用。除此之外,通过集群模块,我们还可以对服务之间的调用链路进行编排优化,治理服务。总的来说,对于 Dubbo 而言,集群容错相关逻辑是非常重要的。想要对 Dubbo 有比较深的理解,集群容错是必须要掌握的。
+
+关于集群模块就先分析到这,感谢阅读。
diff --git a/doc-archive/v2.7.3/docs/zh-cn/source_code_guide/directory.md b/doc-archive/v2.7.3/docs/zh-cn/source_code_guide/directory.md
new file mode 100644
index 0000000..9c71e76
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/source_code_guide/directory.md
@@ -0,0 +1,542 @@
+---
+title: 服务目录
+keywords: Dubbo, Directory
+description: 本文介绍了服务目录的原理和实现细节
+---
+
+## 1. 简介
+
+本篇文章,将开始分析 Dubbo 集群容错方面的源码。集群容错源码包含四个部分,分别是服务目录 Directory、服务路由 Router、集群 Cluster 和负载均衡 LoadBalance。这几个部分的源码逻辑相对比较独立,我们将会分四篇文章进行分析。本篇文章作为集群容错的开篇文章,将和大家一起分析服务目录相关的源码。在进行深入分析之前,我们先来了解一下服务目录是什么。服务目录中存储了一些和服务提供者有关的信息,通过服务目录,服务消费者可获取到服务提供者的信息,比如 ip、端口、服务协议等。通过这些信息,服务消费者就可通过 Netty 等客户端进行远程调用。在一个服务集群中,服务提供者数量并不是一成不变的,如果集群中新增了一台机器,相应地在服务目录中就要新增一条服务提供者记录。或者,如果服务提供者的配置修改了,服务目录中
的记录也要做相应的更新。如果这样说,服务目录和注册中心的功能不就雷同了吗?确实如此,这里这么说是为了方便大家理解。实际上服务目录在获取注册中心的服务配置信息后,会为每条配置信息生成一个 Invoker 对象,并把这个 Invoker 对象存储起来 [...]
+
+关于服务目录这里就先介绍这些,大家先有个大致印象。接下来我们通过继承体系图来了解一下服务目录的家族成员都有哪些。
+
+## 2. 继承体系
+
+服务目录目前内置的实现有两个,分别为 StaticDirectory 和 RegistryDirectory,它们均是 AbstractDirectory 的子类。AbstractDirectory 实现了 Directory 接口,这个接口包含了一个重要的方法定义,即 list(Invocation),用于列举 Invoker。下面我们来看一下他们的继承体系图。
+
+
+
+如上,Directory 继承自 Node 接口,Node 这个接口继承者比较多,像 Registry、Monitor、Invoker 等均继承了这个接口。这个接口包含了一个获取配置信息的方法 getUrl,实现该接口的类可以向外提供配置信息。另外,大家注意看 RegistryDirectory 实现了 NotifyListener 接口,当注册中心节点信息发生变化后,RegistryDirectory 可以通过此接口方法得到变更信息,并根据变更信息动态调整内部 Invoker 列表。
+
+## 3. 源码分析
+
+本章将分析 AbstractDirectory 和它两个子类的源码。AbstractDirectory 封装了 Invoker 列举流程,具体的列举逻辑则由子类实现,这是典型的模板模式。所以,接下来我们先来看一下 AbstractDirectory 的源码。
+
+```java
+public List<Invoker<T>> list(Invocation invocation) throws RpcException {
+ if (destroyed) {
+ throw new RpcException("Directory already destroyed...");
+ }
+
+ // 调用 doList 方法列举 Invoker,doList 是模板方法,由子类实现
+ List<Invoker<T>> invokers = doList(invocation);
+
+ // 获取路由 Router 列表
+ List<Router> localRouters = this.routers;
+ if (localRouters != null && !localRouters.isEmpty()) {
+ for (Router router : localRouters) {
+ try {
+ // 获取 runtime 参数,并根据参数决定是否进行路由
+ if (router.getUrl() == null || router.getUrl().getParameter(Constants.RUNTIME_KEY, false)) {
+ // 进行服务路由
+ invokers = router.route(invokers, getConsumerUrl(), invocation);
+ }
+ } catch (Throwable t) {
+ logger.error("Failed to execute router: ...");
+ }
+ }
+ }
+ return invokers;
+}
+
+// 模板方法,由子类实现
+protected abstract List<Invoker<T>> doList(Invocation invocation) throws RpcException;
+```
+
+上面就是 AbstractDirectory 的 list 方法源码,这个方法封装了 Invoker 的列举过程。如下:
+
+1. 调用 doList 获取 Invoker 列表
+2. 根据 Router 的 getUrl 返回值为空与否,以及 runtime 参数决定是否进行服务路由
+
+以上步骤中,doList 是模板方法,需由子类实现。Router 的 runtime 参数这里简单说明一下,这个参数决定了是否在每次调用服务时都执行路由规则。如果 runtime 为 true,那么每次调用服务前,都需要进行服务路由。这个对性能造成影响,配置时需要注意。
+
+关于 AbstractDirectory 就分析这么多,下面开始分析子类的源码。
+
+### 3.1 StaticDirectory
+
+StaticDirectory 即静态服务目录,顾名思义,它内部存放的 Invoker 是不会变动的。所以,理论上它和不可变 List 的功能很相似。下面我们来看一下这个类的实现。
+
+```java
+public class StaticDirectory<T> extends AbstractDirectory<T> {
+
+ // Invoker 列表
+ private final List<Invoker<T>> invokers;
+
+ // 省略构造方法
+
+ @Override
+ public Class<T> getInterface() {
+ // 获取接口类
+ return invokers.get(0).getInterface();
+ }
+
+ // 检测服务目录是否可用
+ @Override
+ public boolean isAvailable() {
+ if (isDestroyed()) {
+ return false;
+ }
+ for (Invoker<T> invoker : invokers) {
+ if (invoker.isAvailable()) {
+ // 只要有一个 Invoker 是可用的,就认为当前目录是可用的
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void destroy() {
+ if (isDestroyed()) {
+ return;
+ }
+ // 调用父类销毁逻辑
+ super.destroy();
+ // 遍历 Invoker 列表,并执行相应的销毁逻辑
+ for (Invoker<T> invoker : invokers) {
+ invoker.destroy();
+ }
+ invokers.clear();
+ }
+
+ @Override
+ protected List<Invoker<T>> doList(Invocation invocation) throws RpcException {
+ // 列举 Inovker,也就是直接返回 invokers 成员变量
+ return invokers;
+ }
+}
+```
+
+以上就是 StaticDirectory 的代码逻辑,很简单,就不多说了。下面来看看 RegistryDirectory,这个类的逻辑比较复杂。
+
+### 3.2 RegistryDirectory
+
+RegistryDirectory 是一种动态服务目录,实现了 NotifyListener 接口。当注册中心服务配置发生变化后,RegistryDirectory 可收到与当前服务相关的变化。收到变更通知后,RegistryDirectory 可根据配置变更信息刷新 Invoker 列表。RegistryDirectory 中有几个比较重要的逻辑,第一是 Invoker 的列举逻辑,第二是接收服务配置变更的逻辑,第三是 Invoker 列表的刷新逻辑。接下来按顺序对这三块逻辑。
+
+#### 3.2.1 列举 Invoker
+
+Invoker 列举逻辑封装在 doList 方法中,相关代码如下:
+
+```java
+public List<Invoker<T>> doList(Invocation invocation) {
+ if (forbidden) {
+ // 服务提供者关闭或禁用了服务,此时抛出 No provider 异常
+ throw new RpcException(RpcException.FORBIDDEN_EXCEPTION,
+ "No provider available from registry ...");
+ }
+ List<Invoker<T>> invokers = null;
+ // 获取 Invoker 本地缓存
+ Map<String, List<Invoker<T>>> localMethodInvokerMap = this.methodInvokerMap;
+ if (localMethodInvokerMap != null && localMethodInvokerMap.size() > 0) {
+ // 获取方法名和参数列表
+ String methodName = RpcUtils.getMethodName(invocation);
+ Object[] args = RpcUtils.getArguments(invocation);
+ // 检测参数列表的第一个参数是否为 String 或 enum 类型
+ if (args != null && args.length > 0 && args[0] != null
+ && (args[0] instanceof String || args[0].getClass().isEnum())) {
+ // 通过 方法名 + 第一个参数名称 查询 Invoker 列表,具体的使用场景暂时没想到
+ invokers = localMethodInvokerMap.get(methodName + "." + args[0]);
+ }
+ if (invokers == null) {
+ // 通过方法名获取 Invoker 列表
+ invokers = localMethodInvokerMap.get(methodName);
+ }
+ if (invokers == null) {
+ // 通过星号 * 获取 Invoker 列表
+ invokers = localMethodInvokerMap.get(Constants.ANY_VALUE);
+ }
+
+ // 冗余逻辑,pull request #2861 移除了下面的 if 分支代码
+ if (invokers == null) {
+ Iterator<List<Invoker<T>>> iterator = localMethodInvokerMap.values().iterator();
+ if (iterator.hasNext()) {
+ invokers = iterator.next();
+ }
+ }
+ }
+
+ // 返回 Invoker 列表
+ return invokers == null ? new ArrayList<Invoker<T>>(0) : invokers;
+}
+```
+
+以上代码进行多次尝试,以期从 localMethodInvokerMap 中获取到 Invoker 列表。一般情况下,普通的调用可通过方法名获取到对应的 Invoker 列表,泛化调用可通过 ***** 获取到 Invoker 列表。localMethodInvokerMap 源自 RegistryDirectory 类的成员变量 methodInvokerMap。doList 方法可以看做是对 methodInvokerMap 变量的读操作,至于对 methodInvokerMap 变量的写操作,下一节进行分析。
+
+#### 3.2.2 接收服务变更通知
+
+RegistryDirectory 是一个动态服务目录,会随注册中心配置的变化进行动态调整。因此 RegistryDirectory 实现了 NotifyListener 接口,通过这个接口获取注册中心变更通知。下面我们来看一下具体的逻辑。
+
+```java
+public synchronized void notify(List<URL> urls) {
+ // 定义三个集合,分别用于存放服务提供者 url,路由 url,配置器 url
+ List<URL> invokerUrls = new ArrayList<URL>();
+ List<URL> routerUrls = new ArrayList<URL>();
+ List<URL> configuratorUrls = new ArrayList<URL>();
+ for (URL url : urls) {
+ String protocol = url.getProtocol();
+ // 获取 category 参数
+ String category = url.getParameter(Constants.CATEGORY_KEY, Constants.DEFAULT_CATEGORY);
+ // 根据 category 参数将 url 分别放到不同的列表中
+ if (Constants.ROUTERS_CATEGORY.equals(category)
+ || Constants.ROUTE_PROTOCOL.equals(protocol)) {
+ // 添加路由器 url
+ routerUrls.add(url);
+ } else if (Constants.CONFIGURATORS_CATEGORY.equals(category)
+ || Constants.OVERRIDE_PROTOCOL.equals(protocol)) {
+ // 添加配置器 url
+ configuratorUrls.add(url);
+ } else if (Constants.PROVIDERS_CATEGORY.equals(category)) {
+ // 添加服务提供者 url
+ invokerUrls.add(url);
+ } else {
+ // 忽略不支持的 category
+ logger.warn("Unsupported category ...");
+ }
+ }
+ if (configuratorUrls != null && !configuratorUrls.isEmpty()) {
+ // 将 url 转成 Configurator
+ this.configurators = toConfigurators(configuratorUrls);
+ }
+ if (routerUrls != null && !routerUrls.isEmpty()) {
+ // 将 url 转成 Router
+ List<Router> routers = toRouters(routerUrls);
+ if (routers != null) {
+ setRouters(routers);
+ }
+ }
+ List<Configurator> localConfigurators = this.configurators;
+ this.overrideDirectoryUrl = directoryUrl;
+ if (localConfigurators != null && !localConfigurators.isEmpty()) {
+ for (Configurator configurator : localConfigurators) {
+ // 配置 overrideDirectoryUrl
+ this.overrideDirectoryUrl = configurator.configure(overrideDirectoryUrl);
+ }
+ }
+
+ // 刷新 Invoker 列表
+ refreshInvoker(invokerUrls);
+}
+```
+
+如上,notify 方法首先是根据 url 的 category 参数对 url 进行分门别类存储,然后通过 toRouters 和 toConfigurators 将 url 列表转成 Router 和 Configurator 列表。最后调用 refreshInvoker 方法刷新 Invoker 列表。这里的 toRouters 和 toConfigurators 方法逻辑不复杂,大家自行分析。接下来,我们把重点放在 refreshInvoker 方法上。
+
+#### 3.2.3 刷新 Invoker 列表
+
+refreshInvoker 方法是保证 RegistryDirectory 随注册中心变化而变化的关键所在。这一块逻辑比较多,接下来一一进行分析。
+
+```java
+private void refreshInvoker(List<URL> invokerUrls) {
+ // invokerUrls 仅有一个元素,且 url 协议头为 empty,此时表示禁用所有服务
+ if (invokerUrls != null && invokerUrls.size() == 1 && invokerUrls.get(0) != null
+ && Constants.EMPTY_PROTOCOL.equals(invokerUrls.get(0).getProtocol())) {
+ // 设置 forbidden 为 true
+ this.forbidden = true;
+ this.methodInvokerMap = null;
+ // 销毁所有 Invoker
+ destroyAllInvokers();
+ } else {
+ this.forbidden = false;
+ Map<String, Invoker<T>> oldUrlInvokerMap = this.urlInvokerMap;
+ if (invokerUrls.isEmpty() && this.cachedInvokerUrls != null) {
+ // 添加缓存 url 到 invokerUrls 中
+ invokerUrls.addAll(this.cachedInvokerUrls);
+ } else {
+ this.cachedInvokerUrls = new HashSet<URL>();
+ // 缓存 invokerUrls
+ this.cachedInvokerUrls.addAll(invokerUrls);
+ }
+ if (invokerUrls.isEmpty()) {
+ return;
+ }
+ // 将 url 转成 Invoker
+ Map<String, Invoker<T>> newUrlInvokerMap = toInvokers(invokerUrls);
+ // 将 newUrlInvokerMap 转成方法名到 Invoker 列表的映射
+ Map<String, List<Invoker<T>>> newMethodInvokerMap = toMethodInvokers(newUrlInvokerMap);
+ // 转换出错,直接打印异常,并返回
+ if (newUrlInvokerMap == null || newUrlInvokerMap.size() == 0) {
+ logger.error(new IllegalStateException("urls to invokers error ..."));
+ return;
+ }
+ // 合并多个组的 Invoker
+ this.methodInvokerMap = multiGroup ? toMergeMethodInvokerMap(newMethodInvokerMap) : newMethodInvokerMap;
+ this.urlInvokerMap = newUrlInvokerMap;
+ try {
+ // 销毁无用 Invoker
+ destroyUnusedInvokers(oldUrlInvokerMap, newUrlInvokerMap);
+ } catch (Exception e) {
+ logger.warn("destroyUnusedInvokers error. ", e);
+ }
+ }
+}
+```
+
+refreshInvoker 方法首先会根据入参 invokerUrls 的数量和协议头判断是否禁用所有的服务,如果禁用,则将 forbidden 设为 true,并销毁所有的 Invoker。若不禁用,则将 url 转成 Invoker,得到 \<url, Invoker\> 的映射关系。然后进一步进行转换,得到 \<methodName, Invoker 列表\> 映射关系。之后进行多组 Invoker 合并操作,并将合并结果赋值给 methodInvokerMap。methodInvokerMap 变量在 doList 方法中会被用到,doList 会对该变量进行读操作,在这里是写操作。当新的 Invoker 列表生成后,还要一个重要的工作要做,就是销毁无用的 Invoker,避免服务消费者调用已下线的服务的服务。
+
+接下来对 refreshInvoker 方法中涉及到的调用一一进行分析。按照顺序,先来分析 url 到 Invoker 的转换过程。
+
+```java
+private Map<String, Invoker<T>> toInvokers(List<URL> urls) {
+ Map<String, Invoker<T>> newUrlInvokerMap = new HashMap<String, Invoker<T>>();
+ if (urls == null || urls.isEmpty()) {
+ return newUrlInvokerMap;
+ }
+ Set<String> keys = new HashSet<String>();
+ // 获取服务消费端配置的协议
+ String queryProtocols = this.queryMap.get(Constants.PROTOCOL_KEY);
+ for (URL providerUrl : urls) {
+ if (queryProtocols != null && queryProtocols.length() > 0) {
+ boolean accept = false;
+ String[] acceptProtocols = queryProtocols.split(",");
+ // 检测服务提供者协议是否被服务消费者所支持
+ for (String acceptProtocol : acceptProtocols) {
+ if (providerUrl.getProtocol().equals(acceptProtocol)) {
+ accept = true;
+ break;
+ }
+ }
+ if (!accept) {
+ // 若服务消费者协议头不被消费者所支持,则忽略当前 providerUrl
+ continue;
+ }
+ }
+ // 忽略 empty 协议
+ if (Constants.EMPTY_PROTOCOL.equals(providerUrl.getProtocol())) {
+ continue;
+ }
+ // 通过 SPI 检测服务端协议是否被消费端支持,不支持则抛出异常
+ if (!ExtensionLoader.getExtensionLoader(Protocol.class).hasExtension(providerUrl.getProtocol())) {
+ logger.error(new IllegalStateException("Unsupported protocol..."));
+ continue;
+ }
+
+ // 合并 url
+ URL url = mergeUrl(providerUrl);
+
+ String key = url.toFullString();
+ if (keys.contains(key)) {
+ // 忽略重复 url
+ continue;
+ }
+ keys.add(key);
+ // 将本地 Invoker 缓存赋值给 localUrlInvokerMap
+ Map<String, Invoker<T>> localUrlInvokerMap = this.urlInvokerMap;
+ // 获取与 url 对应的 Invoker
+ Invoker<T> invoker = localUrlInvokerMap == null ? null : localUrlInvokerMap.get(key);
+ // 缓存未命中
+ if (invoker == null) {
+ try {
+ boolean enabled = true;
+ if (url.hasParameter(Constants.DISABLED_KEY)) {
+ // 获取 disable 配置,取反,然后赋值给 enable 变量
+ enabled = !url.getParameter(Constants.DISABLED_KEY, false);
+ } else {
+ // 获取 enable 配置,并赋值给 enable 变量
+ enabled = url.getParameter(Constants.ENABLED_KEY, true);
+ }
+ if (enabled) {
+ // 调用 refer 获取 Invoker
+ invoker = new InvokerDelegate<T>(protocol.refer(serviceType, url), url, providerUrl);
+ }
+ } catch (Throwable t) {
+ logger.error("Failed to refer invoker for interface...");
+ }
+ if (invoker != null) {
+ // 缓存 Invoker 实例
+ newUrlInvokerMap.put(key, invoker);
+ }
+
+ // 缓存命中
+ } else {
+ // 将 invoker 存储到 newUrlInvokerMap 中
+ newUrlInvokerMap.put(key, invoker);
+ }
+ }
+ keys.clear();
+ return newUrlInvokerMap;
+}
+```
+
+toInvokers 方法一开始会对服务提供者 url 进行检测,若服务消费端的配置不支持服务端的协议,或服务端 url 协议头为 empty 时,toInvokers 均会忽略服务提供方 url。必要的检测做完后,紧接着是合并 url,然后访问缓存,尝试获取与 url 对应的 invoker。如果缓存命中,直接将 Invoker 存入 newUrlInvokerMap 中即可。如果未命中,则需新建 Invoker。
+
+toInvokers 方法返回的是 \<url, Invoker\> 映射关系表,接下来还要对这个结果进行进一步处理,得到方法名到 Invoker 列表的映射关系。这个过程由 toMethodInvokers 方法完成,如下:
+
+```java
+private Map<String, List<Invoker<T>>> toMethodInvokers(Map<String, Invoker<T>> invokersMap) {
+ // 方法名 -> Invoker 列表
+ Map<String, List<Invoker<T>>> newMethodInvokerMap = new HashMap<String, List<Invoker<T>>>();
+ List<Invoker<T>> invokersList = new ArrayList<Invoker<T>>();
+ if (invokersMap != null && invokersMap.size() > 0) {
+ for (Invoker<T> invoker : invokersMap.values()) {
+ // 获取 methods 参数
+ String parameter = invoker.getUrl().getParameter(Constants.METHODS_KEY);
+ if (parameter != null && parameter.length() > 0) {
+ // 切分 methods 参数值,得到方法名数组
+ String[] methods = Constants.COMMA_SPLIT_PATTERN.split(parameter);
+ if (methods != null && methods.length > 0) {
+ for (String method : methods) {
+ // 方法名不为 *
+ if (method != null && method.length() > 0
+ && !Constants.ANY_VALUE.equals(method)) {
+ // 根据方法名获取 Invoker 列表
+ List<Invoker<T>> methodInvokers = newMethodInvokerMap.get(method);
+ if (methodInvokers == null) {
+ methodInvokers = new ArrayList<Invoker<T>>();
+ newMethodInvokerMap.put(method, methodInvokers);
+ }
+ // 存储 Invoker 到列表中
+ methodInvokers.add(invoker);
+ }
+ }
+ }
+ }
+ invokersList.add(invoker);
+ }
+ }
+
+ // 进行服务级别路由,参考 pull request #749
+ List<Invoker<T>> newInvokersList = route(invokersList, null);
+ // 存储 <*, newInvokersList> 映射关系
+ newMethodInvokerMap.put(Constants.ANY_VALUE, newInvokersList);
+ if (serviceMethods != null && serviceMethods.length > 0) {
+ for (String method : serviceMethods) {
+ List<Invoker<T>> methodInvokers = newMethodInvokerMap.get(method);
+ if (methodInvokers == null || methodInvokers.isEmpty()) {
+ methodInvokers = newInvokersList;
+ }
+ // 进行方法级别路由
+ newMethodInvokerMap.put(method, route(methodInvokers, method));
+ }
+ }
+ // 排序,转成不可变列表
+ for (String method : new HashSet<String>(newMethodInvokerMap.keySet())) {
+ List<Invoker<T>> methodInvokers = newMethodInvokerMap.get(method);
+ Collections.sort(methodInvokers, InvokerComparator.getComparator());
+ newMethodInvokerMap.put(method, Collections.unmodifiableList(methodInvokers));
+ }
+ return Collections.unmodifiableMap(newMethodInvokerMap);
+}
+```
+
+上面方法主要做了三件事情, 第一是对入参进行遍历,然后从 Invoker 的 url 成员变量中获取 methods 参数,并切分成数组。随后以方法名为键,Invoker 列表为值,将映射关系存储到 newMethodInvokerMap 中。第二是分别基于类和方法对 Invoker 列表进行路由操作。第三是对 Invoker 列表进行排序,并转成不可变列表。关于 toMethodInvokers 方法就先分析到这,我们继续向下分析,这次要分析的多组服务的合并逻辑。
+
+```java
+private Map<String, List<Invoker<T>>> toMergeMethodInvokerMap(Map<String, List<Invoker<T>>> methodMap) {
+ Map<String, List<Invoker<T>>> result = new HashMap<String, List<Invoker<T>>>();
+ // 遍历入参
+ for (Map.Entry<String, List<Invoker<T>>> entry : methodMap.entrySet()) {
+ String method = entry.getKey();
+ List<Invoker<T>> invokers = entry.getValue();
+ // group -> Invoker 列表
+ Map<String, List<Invoker<T>>> groupMap = new HashMap<String, List<Invoker<T>>>();
+ // 遍历 Invoker 列表
+ for (Invoker<T> invoker : invokers) {
+ // 获取分组配置
+ String group = invoker.getUrl().getParameter(Constants.GROUP_KEY, "");
+ List<Invoker<T>> groupInvokers = groupMap.get(group);
+ if (groupInvokers == null) {
+ groupInvokers = new ArrayList<Invoker<T>>();
+ // 缓存 <group, List<Invoker>> 到 groupMap 中
+ groupMap.put(group, groupInvokers);
+ }
+ // 存储 invoker 到 groupInvokers
+ groupInvokers.add(invoker);
+ }
+ if (groupMap.size() == 1) {
+ // 如果 groupMap 中仅包含一组键值对,此时直接取出该键值对的值即可
+ result.put(method, groupMap.values().iterator().next());
+
+ // groupMap.size() > 1 成立,表示 groupMap 中包含多组键值对,比如:
+ // {
+ // "dubbo": [invoker1, invoker2, invoker3, ...],
+ // "hello": [invoker4, invoker5, invoker6, ...]
+ // }
+ } else if (groupMap.size() > 1) {
+ List<Invoker<T>> groupInvokers = new ArrayList<Invoker<T>>();
+ for (List<Invoker<T>> groupList : groupMap.values()) {
+ // 通过集群类合并每个分组对应的 Invoker 列表
+ groupInvokers.add(cluster.join(new StaticDirectory<T>(groupList)));
+ }
+ // 缓存结果
+ result.put(method, groupInvokers);
+ } else {
+ result.put(method, invokers);
+ }
+ }
+ return result;
+}
+```
+
+上面方法首先是生成 group 到 Invoker 类比的映射关系表,若关系表中的映射关系数量大于1,表示有多组服务。此时通过集群类合并每组 Invoker,并将合并结果存储到 groupInvokers 中。之后将方法名与 groupInvokers 存到到 result 中,并返回,整个逻辑结束。
+
+接下来我们再来看一下 Invoker 列表刷新逻辑的最后一个动作 — 删除无用 Invoker。如下:
+
+```java
+private void destroyUnusedInvokers(Map<String, Invoker<T>> oldUrlInvokerMap, Map<String, Invoker<T>> newUrlInvokerMap) {
+ if (newUrlInvokerMap == null || newUrlInvokerMap.size() == 0) {
+ destroyAllInvokers();
+ return;
+ }
+
+ List<String> deleted = null;
+ if (oldUrlInvokerMap != null) {
+ // 获取新生成的 Invoker 列表
+ Collection<Invoker<T>> newInvokers = newUrlInvokerMap.values();
+ // 遍历老的 <url, Invoker> 映射表
+ for (Map.Entry<String, Invoker<T>> entry : oldUrlInvokerMap.entrySet()) {
+ // 检测 newInvokers 中是否包含老的 Invoker
+ if (!newInvokers.contains(entry.getValue())) {
+ if (deleted == null) {
+ deleted = new ArrayList<String>();
+ }
+ // 若不包含,则将老的 Invoker 对应的 url 存入 deleted 列表中
+ deleted.add(entry.getKey());
+ }
+ }
+ }
+
+ if (deleted != null) {
+ // 遍历 deleted 集合,并到老的 <url, Invoker> 映射关系表查出 Invoker,销毁之
+ for (String url : deleted) {
+ if (url != null) {
+ // 从 oldUrlInvokerMap 中移除 url 对应的 Invoker
+ Invoker<T> invoker = oldUrlInvokerMap.remove(url);
+ if (invoker != null) {
+ try {
+ // 销毁 Invoker
+ invoker.destroy();
+ } catch (Exception e) {
+ logger.warn("destroy invoker...");
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+destroyUnusedInvokers 方法的主要逻辑是通过 newUrlInvokerMap 找出待删除 Invoker 对应的 url,并将 url 存入到 deleted 列表中。然后再遍历 deleted 列表,并从 oldUrlInvokerMap 中移除相应的 Invoker,销毁之。整个逻辑大致如此,不是很难理解。
+
+到此关于 Invoker 列表的刷新逻辑就分析了,这里对整个过程进行简单总结。如下:
+
+1. 检测入参是否仅包含一个 url,且 url 协议头为 empty
+2. 若第一步检测结果为 true,表示禁用所有服务,此时销毁所有的 Invoker
+3. 若第一步检测结果为 false,此时将入参转为 Invoker 列表
+4. 对将上一步逻辑生成的结果进行进一步处理,得到方法名到 Invoker 的映射关系表
+5. 合并多组 Invoker
+6. 销毁无用 Invoker
+
+Invoker 的刷新逻辑还是比较复杂的,大家在看的过程中多写点 demo 进行调试,以加深理解。
+
+## 4. 总结
+
+本篇文章对 Dubbo 服务目录进行了较为详细的分析,篇幅主要集中在 RegistryDirectory 的源码分析上。从代码量上可以看出,想让本地服务目录和注册中心保持一致还是需要做很多事情的,并不简单。服务目录是 Dubbo 集群容错的一部分,也是比较基础的部分,所以大家应尽量搞懂。
diff --git a/doc-archive/v2.7.3/docs/zh-cn/source_code_guide/dubbo-spi.md b/doc-archive/v2.7.3/docs/zh-cn/source_code_guide/dubbo-spi.md
new file mode 100644
index 0000000..415a989
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/source_code_guide/dubbo-spi.md
@@ -0,0 +1,432 @@
+---
+title: Dubbo SPI
+keywords: Dubbo, SPI
+description: 本文介绍了 Dubbo SPI 的原理和实现细节
+---
+
+## 1.简介
+
+SPI 全称为 Service Provider Interface,是一种服务发现机制。SPI 的本质是将接口实现类的全限定名配置在文件中,并由服务加载器读取配置文件,加载实现类。这样可以在运行时,动态为接口替换实现类。正因此特性,我们可以很容易的通过 SPI 机制为我们的程序提供拓展功能。SPI 机制在第三方框架中也有所应用,比如 Dubbo 就是通过 SPI 机制加载所有的组件。不过,Dubbo 并未使用 Java 原生的 SPI 机制,而是对其进行了增强,使其能够更好的满足需求。在 Dubbo 中,SPI 是一个非常重要的模块。基于 SPI,我们可以很容易的对 Dubbo 进行拓展。如果大家想要学习 Dubbo 的源码,SPI 机制务必弄懂。接下来,我们先来了解一下 Java SPI 与 Dubbo SPI 的用法,然后再来分析 Dubbo SPI 的源码。
+
+需要特别说明的是,本篇文章以及本系列其他文章所分析的源码版本均为 **dubbo-2.6.4**。因此大家在阅读文章的过程中,需注意将代码版本切换到 dubbo-2.6.4 tag 上。
+
+## 2.SPI 示例
+
+### 2.1 Java SPI 示例
+
+前面简单介绍了 SPI 机制的原理,本节通过一个示例演示 Java SPI 的使用方法。首先,我们定义一个接口,名称为 Robot。
+
+```java
+public interface Robot {
+ void sayHello();
+}
+```
+
+接下来定义两个实现类,分别为 OptimusPrime 和 Bumblebee。
+
+```java
+public class OptimusPrime implements Robot {
+
+ @Override
+ public void sayHello() {
+ System.out.println("Hello, I am Optimus Prime.");
+ }
+}
+
+public class Bumblebee implements Robot {
+
+ @Override
+ public void sayHello() {
+ System.out.println("Hello, I am Bumblebee.");
+ }
+}
+```
+
+接下来 META-INF/services 文件夹下创建一个文件,名称为 Robot 的全限定名 org.apache.spi.Robot。文件内容为实现类的全限定的类名,如下:
+
+```
+org.apache.spi.OptimusPrime
+org.apache.spi.Bumblebee
+```
+
+做好所需的准备工作,接下来编写代码进行测试。
+
+```java
+public class JavaSPITest {
+
+ @Test
+ public void sayHello() throws Exception {
+ ServiceLoader<Robot> serviceLoader = ServiceLoader.load(Robot.class);
+ System.out.println("Java SPI");
+ serviceLoader.forEach(Robot::sayHello);
+ }
+}
+```
+
+最后来看一下测试结果,如下:
+
+
+
+从测试结果可以看出,我们的两个实现类被成功的加载,并输出了相应的内容。关于 Java SPI 的演示先到这里,接下来演示 Dubbo SPI。
+
+### 2.2 Dubbo SPI 示例
+
+Dubbo 并未使用 Java SPI,而是重新实现了一套功能更强的 SPI 机制。Dubbo SPI 的相关逻辑被封装在了 ExtensionLoader 类中,通过 ExtensionLoader,我们可以加载指定的实现类。Dubbo SPI 所需的配置文件需放置在 META-INF/dubbo 路径下,配置内容如下。
+
+```
+optimusPrime = org.apache.spi.OptimusPrime
+bumblebee = org.apache.spi.Bumblebee
+```
+
+与 Java SPI 实现类配置不同,Dubbo SPI 是通过键值对的方式进行配置,这样我们可以按需加载指定的实现类。另外,在测试 Dubbo SPI 时,需要在 Robot 接口上标注 @SPI 注解。下面来演示 Dubbo SPI 的用法:
+
+```java
+public class DubboSPITest {
+
+ @Test
+ public void sayHello() throws Exception {
+ ExtensionLoader<Robot> extensionLoader =
+ ExtensionLoader.getExtensionLoader(Robot.class);
+ Robot optimusPrime = extensionLoader.getExtension("optimusPrime");
+ optimusPrime.sayHello();
+ Robot bumblebee = extensionLoader.getExtension("bumblebee");
+ bumblebee.sayHello();
+ }
+}
+```
+
+测试结果如下:
+
+
+
+Dubbo SPI 除了支持按需加载接口实现类,还增加了 IOC 和 AOP 等特性,这些特性将会在接下来的源码分析章节中一一进行介绍。
+
+## 3. Dubbo SPI 源码分析
+
+上一章简单演示了 Dubbo SPI 的使用方法。我们首先通过 ExtensionLoader 的 getExtensionLoader 方法获取一个 ExtensionLoader 实例,然后再通过 ExtensionLoader 的 getExtension 方法获取拓展类对象。这其中,getExtensionLoader 方法用于从缓存中获取与拓展类对应的 ExtensionLoader,若缓存未命中,则创建一个新的实例。该方法的逻辑比较简单,本章就不进行分析了。下面我们从 ExtensionLoader 的 getExtension 方法作为入口,对拓展类对象的获取过程进行详细的分析。
+
+```java
+public T getExtension(String name) {
+ if (name == null || name.length() == 0)
+ throw new IllegalArgumentException("Extension name == null");
+ if ("true".equals(name)) {
+ // 获取默认的拓展实现类
+ return getDefaultExtension();
+ }
+ // Holder,顾名思义,用于持有目标对象
+ Holder<Object> holder = cachedInstances.get(name);
+ if (holder == null) {
+ cachedInstances.putIfAbsent(name, new Holder<Object>());
+ holder = cachedInstances.get(name);
+ }
+ Object instance = holder.get();
+ // 双重检查
+ if (instance == null) {
+ synchronized (holder) {
+ instance = holder.get();
+ if (instance == null) {
+ // 创建拓展实例
+ instance = createExtension(name);
+ // 设置实例到 holder 中
+ holder.set(instance);
+ }
+ }
+ }
+ return (T) instance;
+}
+```
+
+上面代码的逻辑比较简单,首先检查缓存,缓存未命中则创建拓展对象。下面我们来看一下创建拓展对象的过程是怎样的。
+
+```java
+private T createExtension(String name) {
+ // 从配置文件中加载所有的拓展类,可得到“配置项名称”到“配置类”的映射关系表
+ Class<?> clazz = getExtensionClasses().get(name);
+ if (clazz == null) {
+ throw findException(name);
+ }
+ try {
+ T instance = (T) EXTENSION_INSTANCES.get(clazz);
+ if (instance == null) {
+ // 通过反射创建实例
+ EXTENSION_INSTANCES.putIfAbsent(clazz, clazz.newInstance());
+ instance = (T) EXTENSION_INSTANCES.get(clazz);
+ }
+ // 向实例中注入依赖
+ injectExtension(instance);
+ Set<Class<?>> wrapperClasses = cachedWrapperClasses;
+ if (wrapperClasses != null && !wrapperClasses.isEmpty()) {
+ // 循环创建 Wrapper 实例
+ for (Class<?> wrapperClass : wrapperClasses) {
+ // 将当前 instance 作为参数传给 Wrapper 的构造方法,并通过反射创建 Wrapper 实例。
+ // 然后向 Wrapper 实例中注入依赖,最后将 Wrapper 实例再次赋值给 instance 变量
+ instance = injectExtension(
+ (T) wrapperClass.getConstructor(type).newInstance(instance));
+ }
+ }
+ return instance;
+ } catch (Throwable t) {
+ throw new IllegalStateException("...");
+ }
+}
+```
+
+createExtension 方法的逻辑稍复杂一下,包含了如下的步骤:
+
+1. 通过 getExtensionClasses 获取所有的拓展类
+2. 通过反射创建拓展对象
+3. 向拓展对象中注入依赖
+4. 将拓展对象包裹在相应的 Wrapper 对象中
+
+以上步骤中,第一个步骤是加载拓展类的关键,第三和第四个步骤是 Dubbo IOC 与 AOP 的具体实现。在接下来的章节中,将会重点分析 getExtensionClasses 方法的逻辑,以及简单介绍 Dubbo IOC 的具体实现。
+
+### 3.1 获取所有的拓展类
+
+我们在通过名称获取拓展类之前,首先需要根据配置文件解析出拓展项名称到拓展类的映射关系表(Map\<名称, 拓展类\>),之后再根据拓展项名称从映射关系表中取出相应的拓展类即可。相关过程的代码分析如下:
+
+```java
+private Map<String, Class<?>> getExtensionClasses() {
+ // 从缓存中获取已加载的拓展类
+ Map<String, Class<?>> classes = cachedClasses.get();
+ // 双重检查
+ if (classes == null) {
+ synchronized (cachedClasses) {
+ classes = cachedClasses.get();
+ if (classes == null) {
+ // 加载拓展类
+ classes = loadExtensionClasses();
+ cachedClasses.set(classes);
+ }
+ }
+ }
+ return classes;
+}
+```
+
+这里也是先检查缓存,若缓存未命中,则通过 synchronized 加锁。加锁后再次检查缓存,并判空。此时如果 classes 仍为 null,则通过 loadExtensionClasses 加载拓展类。下面分析 loadExtensionClasses 方法的逻辑。
+
+```java
+private Map<String, Class<?>> loadExtensionClasses() {
+ // 获取 SPI 注解,这里的 type 变量是在调用 getExtensionLoader 方法时传入的
+ final SPI defaultAnnotation = type.getAnnotation(SPI.class);
+ if (defaultAnnotation != null) {
+ String value = defaultAnnotation.value();
+ if ((value = value.trim()).length() > 0) {
+ // 对 SPI 注解内容进行切分
+ String[] names = NAME_SEPARATOR.split(value);
+ // 检测 SPI 注解内容是否合法,不合法则抛出异常
+ if (names.length > 1) {
+ throw new IllegalStateException("more than 1 default extension name on extension...");
+ }
+
+ // 设置默认名称,参考 getDefaultExtension 方法
+ if (names.length == 1) {
+ cachedDefaultName = names[0];
+ }
+ }
+ }
+
+ Map<String, Class<?>> extensionClasses = new HashMap<String, Class<?>>();
+ // 加载指定文件夹下的配置文件
+ loadDirectory(extensionClasses, DUBBO_INTERNAL_DIRECTORY);
+ loadDirectory(extensionClasses, DUBBO_DIRECTORY);
+ loadDirectory(extensionClasses, SERVICES_DIRECTORY);
+ return extensionClasses;
+}
+```
+
+loadExtensionClasses 方法总共做了两件事情,一是对 SPI 注解进行解析,二是调用 loadDirectory 方法加载指定文件夹配置文件。SPI 注解解析过程比较简单,无需多说。下面我们来看一下 loadDirectory 做了哪些事情。
+
+```java
+private void loadDirectory(Map<String, Class<?>> extensionClasses, String dir) {
+ // fileName = 文件夹路径 + type 全限定名
+ String fileName = dir + type.getName();
+ try {
+ Enumeration<java.net.URL> urls;
+ ClassLoader classLoader = findClassLoader();
+ // 根据文件名加载所有的同名文件
+ if (classLoader != null) {
+ urls = classLoader.getResources(fileName);
+ } else {
+ urls = ClassLoader.getSystemResources(fileName);
+ }
+ if (urls != null) {
+ while (urls.hasMoreElements()) {
+ java.net.URL resourceURL = urls.nextElement();
+ // 加载资源
+ loadResource(extensionClasses, classLoader, resourceURL);
+ }
+ }
+ } catch (Throwable t) {
+ logger.error("...");
+ }
+}
+```
+
+loadDirectory 方法先通过 classLoader 获取所有资源链接,然后再通过 loadResource 方法加载资源。我们继续跟下去,看一下 loadResource 方法的实现。
+
+```java
+private void loadResource(Map<String, Class<?>> extensionClasses,
+ ClassLoader classLoader, java.net.URL resourceURL) {
+ try {
+ BufferedReader reader = new BufferedReader(
+ new InputStreamReader(resourceURL.openStream(), "utf-8"));
+ try {
+ String line;
+ // 按行读取配置内容
+ while ((line = reader.readLine()) != null) {
+ // 定位 # 字符
+ final int ci = line.indexOf('#');
+ if (ci >= 0) {
+ // 截取 # 之前的字符串,# 之后的内容为注释,需要忽略
+ line = line.substring(0, ci);
+ }
+ line = line.trim();
+ if (line.length() > 0) {
+ try {
+ String name = null;
+ int i = line.indexOf('=');
+ if (i > 0) {
+ // 以等于号 = 为界,截取键与值
+ name = line.substring(0, i).trim();
+ line = line.substring(i + 1).trim();
+ }
+ if (line.length() > 0) {
+ // 加载类,并通过 loadClass 方法对类进行缓存
+ loadClass(extensionClasses, resourceURL,
+ Class.forName(line, true, classLoader), name);
+ }
+ } catch (Throwable t) {
+ IllegalStateException e = new IllegalStateException("Failed to load extension class...");
+ }
+ }
+ }
+ } finally {
+ reader.close();
+ }
+ } catch (Throwable t) {
+ logger.error("Exception when load extension class...");
+ }
+}
+```
+
+loadResource 方法用于读取和解析配置文件,并通过反射加载类,最后调用 loadClass 方法进行其他操作。loadClass 方法用于主要用于操作缓存,该方法的逻辑如下:
+
+```java
+private void loadClass(Map<String, Class<?>> extensionClasses, java.net.URL resourceURL,
+ Class<?> clazz, String name) throws NoSuchMethodException {
+
+ if (!type.isAssignableFrom(clazz)) {
+ throw new IllegalStateException("...");
+ }
+
+ // 检测目标类上是否有 Adaptive 注解
+ if (clazz.isAnnotationPresent(Adaptive.class)) {
+ if (cachedAdaptiveClass == null) {
+ // 设置 cachedAdaptiveClass缓存
+ cachedAdaptiveClass = clazz;
+ } else if (!cachedAdaptiveClass.equals(clazz)) {
+ throw new IllegalStateException("...");
+ }
+
+ // 检测 clazz 是否是 Wrapper 类型
+ } else if (isWrapperClass(clazz)) {
+ Set<Class<?>> wrappers = cachedWrapperClasses;
+ if (wrappers == null) {
+ cachedWrapperClasses = new ConcurrentHashSet<Class<?>>();
+ wrappers = cachedWrapperClasses;
+ }
+ // 存储 clazz 到 cachedWrapperClasses 缓存中
+ wrappers.add(clazz);
+
+ // 程序进入此分支,表明 clazz 是一个普通的拓展类
+ } else {
+ // 检测 clazz 是否有默认的构造方法,如果没有,则抛出异常
+ clazz.getConstructor();
+ if (name == null || name.length() == 0) {
+ // 如果 name 为空,则尝试从 Extension 注解中获取 name,或使用小写的类名作为 name
+ name = findAnnotationName(clazz);
+ if (name.length() == 0) {
+ throw new IllegalStateException("...");
+ }
+ }
+ // 切分 name
+ String[] names = NAME_SEPARATOR.split(name);
+ if (names != null && names.length > 0) {
+ Activate activate = clazz.getAnnotation(Activate.class);
+ if (activate != null) {
+ // 如果类上有 Activate 注解,则使用 names 数组的第一个元素作为键,
+ // 存储 name 到 Activate 注解对象的映射关系
+ cachedActivates.put(names[0], activate);
+ }
+ for (String n : names) {
+ if (!cachedNames.containsKey(clazz)) {
+ // 存储 Class 到名称的映射关系
+ cachedNames.put(clazz, n);
+ }
+ Class<?> c = extensionClasses.get(n);
+ if (c == null) {
+ // 存储名称到 Class 的映射关系
+ extensionClasses.put(n, clazz);
+ } else if (c != clazz) {
+ throw new IllegalStateException("...");
+ }
+ }
+ }
+ }
+}
+```
+
+如上,loadClass 方法操作了不同的缓存,比如 cachedAdaptiveClass、cachedWrapperClasses 和 cachedNames 等等。除此之外,该方法没有其他什么逻辑了。
+
+到此,关于缓存类加载的过程就分析完了。整个过程没什么特别复杂的地方,大家按部就班的分析即可,不懂的地方可以调试一下。接下来,我们来聊聊 Dubbo IOC 方面的内容。
+
+### 3.2 Dubbo IOC
+
+Dubbo IOC 是通过 setter 方法注入依赖。Dubbo 首先会通过反射获取到实例的所有方法,然后再遍历方法列表,检测方法名是否具有 setter 方法特征。若有,则通过 ObjectFactory 获取依赖对象,最后通过反射调用 setter 方法将依赖设置到目标对象中。整个过程对应的代码如下:
+
+```java
+private T injectExtension(T instance) {
+ try {
+ if (objectFactory != null) {
+ // 遍历目标类的所有方法
+ for (Method method : instance.getClass().getMethods()) {
+ // 检测方法是否以 set 开头,且方法仅有一个参数,且方法访问级别为 public
+ if (method.getName().startsWith("set")
+ && method.getParameterTypes().length == 1
+ && Modifier.isPublic(method.getModifiers())) {
+ // 获取 setter 方法参数类型
+ Class<?> pt = method.getParameterTypes()[0];
+ try {
+ // 获取属性名,比如 setName 方法对应属性名 name
+ String property = method.getName().length() > 3 ?
+ method.getName().substring(3, 4).toLowerCase() +
+ method.getName().substring(4) : "";
+ // 从 ObjectFactory 中获取依赖对象
+ Object object = objectFactory.getExtension(pt, property);
+ if (object != null) {
+ // 通过反射调用 setter 方法设置依赖
+ method.invoke(instance, object);
+ }
+ } catch (Exception e) {
+ logger.error("fail to inject via method...");
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ }
+ return instance;
+}
+```
+
+在上面代码中,objectFactory 变量的类型为 AdaptiveExtensionFactory,AdaptiveExtensionFactory 内部维护了一个 ExtensionFactory 列表,用于存储其他类型的 ExtensionFactory。Dubbo 目前提供了两种 ExtensionFactory,分别是 SpiExtensionFactory 和 SpringExtensionFactory。前者用于创建自适应的拓展,后者是用于从 Spring 的 IOC 容器中获取所需的拓展。这两个类的类的代码不是很复杂,这里就不一一分析了。
+
+Dubbo IOC 目前仅支持 setter 方式注入,总的来说,逻辑比较简单易懂。
+
+## 4.总结
+
+本篇文章简单分别介绍了 Java SPI 与 Dubbo SPI 用法,并对 Dubbo SPI 的加载拓展类的过程进行了分析。另外,在 Dubbo SPI 中还有一块重要的逻辑这里没有进行分析,即 Dubbo SPI 的扩展点自适应机制。该机制的逻辑较为复杂,我们将会在下一篇文章中进行详细的分析。
+
+好了,本篇文章就先到这里了。如果文章中有错误不妥之处,欢迎大家提 issue 进行反馈,或者提 pull request 进行修正。让我们携手共建 Dubbo 社区。
diff --git a/doc-archive/v2.7.3/docs/zh-cn/source_code_guide/export-service.md b/doc-archive/v2.7.3/docs/zh-cn/source_code_guide/export-service.md
new file mode 100644
index 0000000..5092dfb
--- /dev/null
+++ b/doc-archive/v2.7.3/docs/zh-cn/source_code_guide/export-service.md
@@ -0,0 +1,1518 @@
+---
+title: 服务导出
+keywords: Dubbo, service, export
+description: 本文介绍了 Dubbo 服务导出的过程和实现细节
+---
+
+## 1.简介
+本篇文章,我们来研究一下 Dubbo 导出服务的过程。Dubbo 服务导出过程始于 Spring 容器发布刷新事件,Dubbo 在接收到事件后,会立即执行服务导出逻辑。整个逻辑大致可分为三个部分,第一部分是前置工作,主要用于检查参数,组装 URL。第二部分是导出服务,包含导出服务到本地 (JVM),和导出服务到远程两个过程。第三部分是向注册中心注册服务,用于服务发现。本篇文章将会对这三个部分代码进行详细的分析。
+
+## 2.源码分析
+
+服务导出的入口方法是 ServiceBean 的 onApplicationEvent。onApplicationEvent 是一个事件响应方法,该方法会在收到 Spring 上下文刷新事件后执行服务导出操作。方法代码如下:
+
+```java
+public void onApplicationEvent(ContextRefreshedEvent event) {
+ // 是否有延迟导出 && 是否已导出 && 是不是已被取消导出
+ if (isDelay() && !isExported() && !isUnexported()) {
+ // 导出服务
+ export();
+ }
+}
+```
+
+这个方法首先会根据条件决定是否导出服务,比如有些服务设置了延时导出,那么此时就不应该在此处导出。还有一些服务已经被导出了,或者当前服务被取消导出了,此时也不能再次导出相关服务。注意这里的 isDelay 方法,这个方法字面意思是“是否延迟导出服务”,返回 true 表示延迟导出,false 表示不延迟导出。但是该方法真实意思却并非如此,当方法返回 true 时,表示无需延迟导出。返回 false 时,表示需要延迟导出。与字面意思恰恰相反,这个需要大家注意一下。下面我们来看一下这个方法的逻辑。
+
+```java
+// -☆- ServiceBean
+private boolean isDelay() {
+ // 获取 delay
+ Integer delay = getDelay();
+ ProviderConfig provider = getProvider();
+ if (delay == null && provider != null) {
+ // 如果前面获取的 delay 为空,这里继续获取
+ delay = provider.getDelay();
+ }
+ // 判断 delay 是否为空,或者等于 -1
+ return supportedApplicationListener && (delay == null || delay == -1);
+}
+```
+
+暂时忽略 supportedApplicationListener 这个条件,当 delay 为空,或者等于-1时,该方法返回 true,而不是 false。这个方法的返回值让人有点困惑。该方法目前已被重构,详细请参考 [dubbo #2686](https://github.com/apache/dubbo/pull/2686)。
+
+现在解释一下 supportedApplicationListener 变量含义,该变量用于表示当前的 Spring 容器是否支持 ApplicationListener,这个值初始为 false。在 Spring 容器将自己设置到 ServiceBean 中时,ServiceBean 的 setApplicationContext 方法会检测 Spring 容器是否支持 ApplicationListener。若支持,则将 supportedApplicationListener 置为 true。ServiceBean 是 Dubbo 与 Spring 框架进行整合的关键,可以看做是两个框架之间的桥梁。具有同样作用的类还有 ReferenceBean。
+
+现在我们知道了 Dubbo 服务导出过程的起点,接下来对服务导出的前置逻辑进行分析。
+
+### 2.1 前置工作
+
+前置工作主要包含两个部分,分别是配置检查,以及 URL 装配。在导出服务之前,Dubbo 需要检查用户的配置是否合理,或者为用户补充缺省配置。配置检查完成后,接下来需要根据这些配置组装 URL。在 Dubbo 中,URL 的作用十分重要。Dubbo 使用 URL 作为配置载体,所有的拓展点都是通过 URL 获取配置。这一点,官方文档中有所说明。
+
+> 采用 URL 作为配置信息的统一格式,所有扩展点都通过传递 URL 携带配置信息。
+
+接下来,我们先来分析配置检查部分的源码,随后再来分析 URL 组装部分的源码。
+
+#### 2.1.1 检查配置
+
+本节我们接着前面的源码向下分析,前面说过 onApplicationEvent 方法在经过一些判断后,会决定是否调用 export 方法导出服务。那么下面我们从 export 方法开始进行分析,如下:
+
+```java
+public synchronized void export() {
+ if (provider != null) {
+ // 获取 export 和 delay 配置
+ if (export == null) {
+ export = provider.getExport();
+ }
+ if (delay == null) {
+ delay = provider.getDelay();
+ }
+ }
+ // 如果 export 为 false,则不导出服务
+ if (export != null && !export) {
+ return;
+ }
+
+ // delay > 0,延时导出服务
+ if (delay != null && delay > 0) {
+ delayExportExecutor.schedule(new Runnable() {
+ @Override
+ public void run() {
+ doExport();
+ }
+ }, delay, TimeUnit.MILLISECONDS);
+
+ // 立即导出服务
+ } else {
+ doExport();
+ }
+}
+```
+
+export 方法对两项配置进行了检查,并根据配置执行相应的动作。首先是 export 配置,这个配置决定了是否导出服务。有时候我们只是想本地启动服务进行一些调试工作,我们并不希望把本地启动的服务暴露出去给别人调用。此时,我们可通过配置 export 禁止服务导出,比如:
+
+```xml
+<dubbo:provider export="false" />
+```
+
+delay 配置顾名思义,用于延迟导出服务,这个就不分析了。下面,我们继续分析源码,这次要分析的是 doExport 方法。
+
+
+```java
+protected synchronized void doExport() {
+ if (unexported) {
+ throw new IllegalStateException("Already unexported!");
+ }
+ if (exported) {
+ return;
+ }
+ exported = true;
+ // 检测 interfaceName 是否合法
+ if (interfaceName == null || interfaceName.length() == 0) {
+ throw new IllegalStateException("interface not allow null!");
+ }
+ // 检测 provider 是否为空,为空则新建一个,并通过系统变量为其初始化
+ checkDefault();
+
+ // 下面几个 if 语句用于检测 provider、application 等核心配置类对象是否为空,
+ // 若为空,则尝试从其他配置类对象中获取相应的实例。
+ if (provider != null) {
+ if (application == null) {
+ application = provider.getApplication();
+ }
+ if (module == null) {
+ module = provider.getModule();
+ }
+ if (registries == null) {...}
+ if (monitor == null) {...}
+ if (protocols == null) {...}
+ }
+ if (module != null) {
+ if (registries == null) {
+ registries = module.getRegistries();
+ }
+ if (monitor == null) {...}
+ }
+ if (application != null) {
+ if (registries == null) {
+ registries = application.getRegistries();
+ }
+ if (monitor == null) {...}
+ }
+
+ // 检测 ref 是否为泛化服务类型
+ if (ref instanceof GenericService) {
+ // 设置 interfaceClass 为 GenericService.class
+ interfaceClass = GenericService.class;
+ if (StringUtils.isEmpty(generic)) {
+ // 设置 generic = "true"
+ generic = Boolean.TRUE.toString();
+ }
+
+ // ref 非 GenericService 类型
+ } else {
+ try {
+ interfaceClass = Class.forName(interfaceName, true, Thread.currentThread()
+ .getContextClassLoader());
+ } catch (ClassNotFoundException e) {
+ throw new IllegalStateException(e.getMessage(), e);
+ }
+ // 对 interfaceClass,以及 <dubbo:method> 标签中的必要字段进行检查
+ checkInterfaceAndMethods(interfaceClass, methods);
+ // 对 ref 合法性进行检测
+ checkRef();
+ // 设置 generic = "false"
+ generic = Boolean.FALSE.toString();
+ }
+
+ // local 和 stub 在功能应该是一致的,用于配置本地存根
+ if (local != null) {
+ if ("true".equals(local)) {
+ local = interfaceName + "Local";
+ }
+ Class<?> localClass;
+ try {
+ // 获取本地存根类
+ localClass = ClassHelper.forNameWithThreadContextClassLoader(local);
+ } catch (ClassNotFoundException e) {
+ throw new IllegalStateException(e.getMessage(), e);
+ }
+ // 检测本地存根类是否可赋值给接口类,若不可赋值则会抛出异常,提醒使用者本地存根类类型不合法
+ if (!interfaceClass.isAssignableFrom(localClass)) {
+ throw new IllegalStateException("The local implementation class " + localClass.getName() + " not implement interface " + interfaceName);
+ }
+ }
+
+ if (stub != null) {
+ // 此处的代码和上一个 if 分支的代码基本一致,这里省略
+ }
+
+ // 检测各种对象是否为空,为空则新建,或者抛出异常
+ checkApplication();
+ checkRegistry();
+ checkProtocol();
+ appendProperties(this);
+ checkStubAndMock(interfaceClass);
+ if (path == null || path.length() == 0) {
+ path = interfaceName;
+ }
+
+ // 导出服务
+ doExportUrls();
+
+ // ProviderModel 表示服务提供者模型,此对象中存储了与服务提供者相关的信息。
+ // 比如服务的配置信息,服务实例等。每个被导出的服务对应一个 ProviderModel。
+ // ApplicationModel 持有所有的 ProviderModel。
+ ProviderModel providerModel = new ProviderModel(getUniqueServiceName(), this, ref);
+ ApplicationModel.initProviderModel(getUniqueServiceName(), providerModel);
+}
+```
+
+以上就是配置检查的相关分析,代码比较多,需要大家耐心看一下。下面对配置检查的逻辑进行简单的总结,如下:
+
+1. 检测 \<dubbo:service\> 标签的 interface 属性合法性,不合法则抛出异常
+2. 检测 ProviderConfig、ApplicationConfig 等核心配置类对象是否为空,若为空,则尝试从其他配置类对象中获取相应的实例。
+3. 检测并处理泛化服务和普通服务类
+4. 检测本地存根配置,并进行相应的处理
+5. 对 ApplicationConfig、RegistryConfig 等配置类进行检测,为空则尝试创建,若无法创建则抛出异常
+
+配置检查并非本文重点,因此这里不打算对 doExport 方法所调用的方法进行分析(doExportUrls 方法除外)。在这些方法中,除了 appendProperties 方法稍微复杂一些,其他方法逻辑不是很复杂。因此,大家可自行分析。
+
+#### 2.1.2 多协议多注册中心导出服务
+
... 16381 lines suppressed ...