blob: d0272d430d53f8c2d19a43d70462fa941c8a5739 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="" >
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>7.1 dubbo:// · GitBook</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta name="generator" content="GitBook 3.2.2">
<link rel="stylesheet" href="../gitbook/style.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="next" href="rmi.html" />
<link rel="prev" href="introduction.html" />
</head>
<body>
<div class="book">
<div class="book-summary">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search" />
</div>
<nav role="navigation">
<ul class="summary">
<li class="chapter " data-level="1.1" data-path="../">
<a href="../">
Introduction
</a>
</li>
<li class="chapter " data-level="1.2" >
<span>
1 入门
</span>
<ul class="articles">
<li class="chapter " data-level="1.2.1" data-path="../preface/background.html">
<a href="../preface/background.html">
1.1 背景
</a>
</li>
<li class="chapter " data-level="1.2.2" data-path="../preface/requirements.html">
<a href="../preface/requirements.html">
1.2 需求
</a>
</li>
<li class="chapter " data-level="1.2.3" data-path="../preface/architacture.html">
<a href="../preface/architacture.html">
1.3 架构
</a>
</li>
<li class="chapter " data-level="1.2.4" data-path="../preface/usage.html">
<a href="../preface/usage.html">
1.4 用法
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.3" >
<span>
2 快速启动
</span>
<ul class="articles">
<li class="chapter " data-level="1.3.1" data-path="../dependencies/dependencies.html">
<a href="../dependencies/dependencies.html">
2.1 依赖
</a>
</li>
<li class="chapter " data-level="1.3.2" data-path="../maturity/maturity.html">
<a href="../maturity/maturity.html">
2.2 成熟度
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.4" >
<span>
3 配置
</span>
<ul class="articles">
<li class="chapter " data-level="1.4.1" data-path="../configuration/xml.html">
<a href="../configuration/xml.html">
3.1 XML配置
</a>
</li>
<li class="chapter " data-level="1.4.2" data-path="../configuration/properties.html">
<a href="../configuration/properties.html">
3.2 属性配置
</a>
</li>
<li class="chapter " data-level="1.4.3" data-path="../configuration/api.html">
<a href="../configuration/api.html">
3.3 API配置
</a>
</li>
<li class="chapter " data-level="1.4.4" data-path="../configuration/annotation.html">
<a href="../configuration/annotation.html">
3.4 注解配置
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.5" >
<span>
4 示例
</span>
<ul class="articles">
<li class="chapter " data-level="1.5.1" data-path="../demos/启动时检查.html">
<a href="../demos/启动时检查.html">
4.1 启动时检查
</a>
</li>
<li class="chapter " data-level="1.5.2" data-path="../demos/集群容错.html">
<a href="../demos/集群容错.html">
4.2 集群容错
</a>
</li>
<li class="chapter " data-level="1.5.3" data-path="../demos/负载均衡.html">
<a href="../demos/负载均衡.html">
4.3 负载均衡
</a>
</li>
<li class="chapter " data-level="1.5.4" data-path="../demos/线程模型.html">
<a href="../demos/线程模型.html">
4.4 线程模型
</a>
</li>
<li class="chapter " data-level="1.5.5" data-path="../demos/直连提供者.html">
<a href="../demos/直连提供者.html">
4.5 直连提供者
</a>
</li>
<li class="chapter " data-level="1.5.6" data-path="../demos/只订阅.html">
<a href="../demos/只订阅.html">
4.6 只订阅
</a>
</li>
<li class="chapter " data-level="1.5.7" data-path="../demos/只注册.html">
<a href="../demos/只注册.html">
4.7 只注册
</a>
</li>
<li class="chapter " data-level="1.5.8" data-path="../demos/静态服务.html">
<a href="../demos/静态服务.html">
4.8 静态服务
</a>
</li>
<li class="chapter " data-level="1.5.9" data-path="../demos/多协议.html">
<a href="../demos/多协议.html">
4.9 多协议
</a>
</li>
<li class="chapter " data-level="1.5.10" data-path="../demos/多注册中心.html">
<a href="../demos/多注册中心.html">
4.10 多注册中心
</a>
</li>
<li class="chapter " data-level="1.5.11" data-path="../demos/服务分组.html">
<a href="../demos/服务分组.html">
4.11 服务分组
</a>
</li>
<li class="chapter " data-level="1.5.12" data-path="../demos/多版本.html">
<a href="../demos/多版本.html">
4.13 多版本
</a>
</li>
<li class="chapter " data-level="1.5.13" data-path="../demos/分组聚合.html">
<a href="../demos/分组聚合.html">
4.14 分组聚合
</a>
</li>
<li class="chapter " data-level="1.5.14" data-path="../demos/参数验证.html">
<a href="../demos/参数验证.html">
4.15 参数验证
</a>
</li>
<li class="chapter " data-level="1.5.15" data-path="../demos/结果缓存.html">
<a href="../demos/结果缓存.html">
4.16 结果缓存
</a>
</li>
<li class="chapter " data-level="1.5.16" data-path="../demos/泛化引用.html">
<a href="../demos/泛化引用.html">
4.17 泛化引用
</a>
</li>
<li class="chapter " data-level="1.5.17" data-path="../demos/泛化实现.html">
<a href="../demos/泛化实现.html">
4.18 泛化实现
</a>
</li>
<li class="chapter " data-level="1.5.18" data-path="../demos/回声测试.html">
<a href="../demos/回声测试.html">
4.19 回声测试
</a>
</li>
<li class="chapter " data-level="1.5.19" data-path="../demos/上下文信息.html">
<a href="../demos/上下文信息.html">
4.20 上下文信息
</a>
</li>
<li class="chapter " data-level="1.5.20" data-path="../demos/隐式传参.html">
<a href="../demos/隐式传参.html">
4.21 隐式参数
</a>
</li>
<li class="chapter " data-level="1.5.21" data-path="../demos/异步调用.html">
<a href="../demos/异步调用.html">
4.22 异步调用
</a>
</li>
<li class="chapter " data-level="1.5.22" data-path="../demos/本地调用.html">
<a href="../demos/本地调用.html">
4.23 本地调用
</a>
</li>
<li class="chapter " data-level="1.5.23" data-path="../demos/参数回调.html">
<a href="../demos/参数回调.html">
4.24 参数回调
</a>
</li>
<li class="chapter " data-level="1.5.24" data-path="../demos/事件通知.html">
<a href="../demos/事件通知.html">
4.25 事件通知
</a>
</li>
<li class="chapter " data-level="1.5.25" data-path="../demos/本地存根.html">
<a href="../demos/本地存根.html">
4.26 本地存根
</a>
</li>
<li class="chapter " data-level="1.5.26" data-path="../demos/本地伪装.html">
<a href="../demos/本地伪装.html">
4.27 本地伪装
</a>
</li>
<li class="chapter " data-level="1.5.27" data-path="../demos/延迟暴露.html">
<a href="../demos/延迟暴露.html">
4.28 延迟暴露
</a>
</li>
<li class="chapter " data-level="1.5.28" data-path="../demos/并发控制.html">
<a href="../demos/并发控制.html">
4.29 并发控制
</a>
</li>
<li class="chapter " data-level="1.5.29" data-path="../demos/连接控制.html">
<a href="../demos/连接控制.html">
4.30 连接控制
</a>
</li>
<li class="chapter " data-level="1.5.30" data-path="../demos/延迟连接.html">
<a href="../demos/延迟连接.html">
4.31 延迟连接
</a>
</li>
<li class="chapter " data-level="1.5.31" data-path="../demos/粘滞连接.html">
<a href="../demos/粘滞连接.html">
4.32 粘滞连接
</a>
</li>
<li class="chapter " data-level="1.5.32" data-path="../demos/令牌验证.html">
<a href="../demos/令牌验证.html">
4.33 令牌验证
</a>
</li>
<li class="chapter " data-level="1.5.33" data-path="../demos/路由规则.html">
<a href="../demos/路由规则.html">
4.34 路由规则
</a>
</li>
<li class="chapter " data-level="1.5.34" data-path="../demos/配置规则.html">
<a href="../demos/配置规则.html">
4.35 配置规则
</a>
</li>
<li class="chapter " data-level="1.5.35" data-path="../demos/服务降级.html">
<a href="../demos/服务降级.html">
4.36 服务降级
</a>
</li>
<li class="chapter " data-level="1.5.36" data-path="../demos/优雅停机.html">
<a href="../demos/优雅停机.html">
4.37 优雅停机
</a>
</li>
<li class="chapter " data-level="1.5.37" data-path="../demos/主机绑定.html">
<a href="../demos/主机绑定.html">
4.38 主机绑定
</a>
</li>
<li class="chapter " data-level="1.5.38" data-path="../demos/日志适配.html">
<a href="../demos/日志适配.html">
4.39 日志适配
</a>
</li>
<li class="chapter " data-level="1.5.39" data-path="../demos/访问日志.html">
<a href="../demos/访问日志.html">
4.40 访问日志
</a>
</li>
<li class="chapter " data-level="1.5.40" data-path="../demos/服务容器.html">
<a href="../demos/服务容器.html">
4.41 服务容器
</a>
</li>
<li class="chapter " data-level="1.5.41" data-path="../demos/ReferenceConfig缓存.html">
<a href="../demos/ReferenceConfig缓存.html">
4.42 Reference Config缓存
</a>
</li>
<li class="chapter " data-level="1.5.42" data-path="../demos/分布式事务.html">
<a href="../demos/分布式事务.html">
4.43 分布式事务
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.6" data-path="../reference-apiconf/api.html">
<a href="../reference-apiconf/api.html">
5 API参考手册
</a>
</li>
<li class="chapter " data-level="1.7" data-path="../reference-xmlconf/introduction.html">
<a href="../reference-xmlconf/introduction.html">
6 schema配置参考手册
</a>
<ul class="articles">
<li class="chapter " data-level="1.7.1" data-path="../reference-xmlconf/dubbo-service.html">
<a href="../reference-xmlconf/dubbo-service.html">
6.1 dubbo:service
</a>
</li>
<li class="chapter " data-level="1.7.2" data-path="../reference-xmlconf/dubbo-reference.html">
<a href="../reference-xmlconf/dubbo-reference.html">
6.2 dubbo:reference
</a>
</li>
<li class="chapter " data-level="1.7.3" data-path="../reference-xmlconf/dubbo-protocol.html">
<a href="../reference-xmlconf/dubbo-protocol.html">
6.3 dubbo:protocol
</a>
</li>
<li class="chapter " data-level="1.7.4" data-path="../reference-xmlconf/dubbo-registry.html">
<a href="../reference-xmlconf/dubbo-registry.html">
6.4 dubbo:registry
</a>
</li>
<li class="chapter " data-level="1.7.5" data-path="../reference-xmlconf/dubbo-monitor.html">
<a href="../reference-xmlconf/dubbo-monitor.html">
6.5 dubbo:monitor
</a>
</li>
<li class="chapter " data-level="1.7.6" data-path="../reference-xmlconf/dubbo-application.html">
<a href="../reference-xmlconf/dubbo-application.html">
6.6 dubbo:application
</a>
</li>
<li class="chapter " data-level="1.7.7" data-path="../reference-xmlconf/dubbo-module.html">
<a href="../reference-xmlconf/dubbo-module.html">
6.7 dubbo:module
</a>
</li>
<li class="chapter " data-level="1.7.8" data-path="../reference-xmlconf/dubbo-provider.html">
<a href="../reference-xmlconf/dubbo-provider.html">
6.8 dubbo:provider
</a>
</li>
<li class="chapter " data-level="1.7.9" data-path="../reference-xmlconf/dubbo-consumer.html">
<a href="../reference-xmlconf/dubbo-consumer.html">
6.9 dubbo:consumer
</a>
</li>
<li class="chapter " data-level="1.7.10" data-path="../reference-xmlconf/dubbo-method.html">
<a href="../reference-xmlconf/dubbo-method.html">
6.10 dubbo:method
</a>
</li>
<li class="chapter " data-level="1.7.11" data-path="../reference-xmlconf/dubbo-argument.html">
<a href="../reference-xmlconf/dubbo-argument.html">
6.11 dubbo:argument
</a>
</li>
<li class="chapter " data-level="1.7.12" data-path="../reference-xmlconf/dubbo-parameter.html">
<a href="../reference-xmlconf/dubbo-parameter.html">
6.12 dubbo:parameter
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.8" data-path="introduction.html">
<a href="introduction.html">
7 协议参考手册
</a>
<ul class="articles">
<li class="chapter active" data-level="1.8.1" data-path="dubbo.html">
<a href="dubbo.html">
7.1 dubbo://
</a>
</li>
<li class="chapter " data-level="1.8.2" data-path="rmi.html">
<a href="rmi.html">
7.2 rmi//
</a>
</li>
<li class="chapter " data-level="1.8.3" data-path="hessian.html">
<a href="hessian.html">
7.3 hessian://
</a>
</li>
<li class="chapter " data-level="1.8.4" data-path="http.html">
<a href="http.html">
7.4 http://
</a>
</li>
<li class="chapter " data-level="1.8.5" data-path="webservice.html">
<a href="webservice.html">
7.5 webservice://
</a>
</li>
<li class="chapter " data-level="1.8.6" data-path="thrift.html">
<a href="thrift.html">
7.6 thrift://
</a>
</li>
<li class="chapter " data-level="1.8.7" data-path="memcached.html">
<a href="memcached.html">
7.7 memcached://
</a>
</li>
<li class="chapter " data-level="1.8.8" data-path="redis.html">
<a href="redis.html">
7.8 redis://
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.9" data-path="../reference-registry/introduction.html">
<a href="../reference-registry/introduction.html">
8 注册中心参考手册
</a>
<ul class="articles">
<li class="chapter " data-level="1.9.1" data-path="../reference-registry/multicast.html">
<a href="../reference-registry/multicast.html">
8.1 Multicast注册中心
</a>
</li>
<li class="chapter " data-level="1.9.2" data-path="../reference-registry/zookeeper.html">
<a href="../reference-registry/zookeeper.html">
8.2 Zookeeper注册中心
</a>
</li>
<li class="chapter " data-level="1.9.3" data-path="../reference-registry/redis.html">
<a href="../reference-registry/redis.html">
8.3 Redis注册中心
</a>
</li>
<li class="chapter " data-level="1.9.4" data-path="../reference-registry/simple.html">
<a href="../reference-registry/simple.html">
8.4 Simple注册中心
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.10" data-path="../reference-telnet/telnet.html">
<a href="../reference-telnet/telnet.html">
9 telnet命令参考手册
</a>
</li>
<li class="chapter " data-level="1.11" data-path="../reference-maven/maven.html">
<a href="../reference-maven/maven.html">
10 maven插件参考手册
</a>
</li>
<li class="chapter " data-level="1.12" data-path="../best-practice.html">
<a href="../best-practice.html">
11 服务化最佳实践
</a>
</li>
<li class="chapter " data-level="1.13" data-path="../recommend.html">
<a href="../recommend.html">
12 推荐用法
</a>
</li>
<li class="chapter " data-level="1.14" data-path="../capacity-plan.html">
<a href="../capacity-plan.html">
13 容量规划
</a>
</li>
<li class="chapter " data-level="1.15" data-path="../benchmark.html">
<a href="../benchmark.html">
14 基准测试工具包
</a>
</li>
<li class="chapter " data-level="1.16" data-path="../perf-test.html">
<a href="../perf-test.html">
15 性能测试报告
</a>
</li>
<li class="chapter " data-level="1.17" data-path="../coveragence.html">
<a href="../coveragence.html">
16 测试覆盖率报告
</a>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href=".." >7.1 dubbo://</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<div id="book-search-results">
<div class="search-noresults">
<section class="normal markdown-section">
<blockquote>
<p><img src="../sources/images/check.gif" alt="warning">Dubbo&#x7F3A;&#x7701;&#x534F;&#x8BAE;&#x91C7;&#x7528;&#x5355;&#x4E00;&#x957F;&#x8FDE;&#x63A5;&#x548C;NIO&#x5F02;&#x6B65;&#x901A;&#x8BAF;&#xFF0C;&#x9002;&#x5408;&#x4E8E;&#x5C0F;&#x6570;&#x636E;&#x91CF;&#x5927;&#x5E76;&#x53D1;&#x7684;&#x670D;&#x52A1;&#x8C03;&#x7528;&#xFF0C;&#x4EE5;&#x53CA;&#x670D;&#x52A1;&#x6D88;&#x8D39;&#x8005;&#x673A;&#x5668;&#x6570;&#x8FDC;&#x5927;&#x4E8E;&#x670D;&#x52A1;&#x63D0;&#x4F9B;&#x8005;&#x673A;&#x5668;&#x6570;&#x7684;&#x60C5;&#x51B5;&#x3002;</p>
<p><img src="../sources/images/warning-3.gif" alt="warning">Dubbo&#x7F3A;&#x7701;&#x534F;&#x8BAE;&#x4E0D;&#x9002;&#x5408;&#x4F20;&#x9001;&#x5927;&#x6570;&#x636E;&#x91CF;&#x7684;&#x670D;&#x52A1;&#xFF0C;&#x6BD4;&#x5982;&#x4F20;&#x6587;&#x4EF6;&#xFF0C;&#x4F20;&#x89C6;&#x9891;&#x7B49;&#xFF0C;&#x9664;&#x975E;&#x8BF7;&#x6C42;&#x91CF;&#x5F88;&#x4F4E;&#x3002;</p>
</blockquote>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">dubbo:protocol</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;dubbo&quot;</span> <span class="hljs-attr">port</span>=<span class="hljs-string">&quot;20880&quot;</span> /&gt;</span>
</code></pre>
<p>&#x8BBE;&#x7F6E;&#x9ED8;&#x8BA4;&#x534F;&#x8BAE;&#xFF1A;</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">dubbo:provider</span> <span class="hljs-attr">protocol</span>=<span class="hljs-string">&quot;dubbo&quot;</span> /&gt;</span>
</code></pre>
<p>&#x8BBE;&#x7F6E;&#x670D;&#x52A1;&#x534F;&#x8BAE;&#xFF1A;</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">dubbo:service</span> <span class="hljs-attr">protocol</span>=<span class="hljs-string">&quot;dubbo&quot;</span> /&gt;</span>
</code></pre>
<p>&#x591A;&#x7AEF;&#x53E3;&#xFF1A;</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">dubbo:protocol</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&#x201C;dubbo&#x201D;</span> <span class="hljs-attr">port</span>=<span class="hljs-string">&#x201C;9090&#x201D;</span> <span class="hljs-attr">server</span>=<span class="hljs-string">&#x201C;netty&#x201D;</span> <span class="hljs-attr">client</span>=<span class="hljs-string">&#x201C;netty&#x201D;</span> <span class="hljs-attr">codec</span>=<span class="hljs-string">&#x201C;dubbo&#x201D;</span> <span class="hljs-attr">serialization</span>=<span class="hljs-string">&#x201C;hessian2&#x201D;</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">&#x201C;UTF-8&#x201D;</span> <span class="hljs-attr">threadpool</span>=<span class="hljs-string">&#x201C;fixed&#x201D;</span> <span class="hljs-attr">threads</span>=<span class="hljs-string">&#x201C;100&#x201D;</span> <span class="hljs-attr">queues</span>=<span class="hljs-string">&#x201C;0&#x201D;</span> <span class="hljs-attr">iothreads</span>=<span class="hljs-string">&#x201C;9&#x201D;</span> <span class="hljs-attr">buffer</span>=<span class="hljs-string">&#x201C;8192&#x201D;</span> <span class="hljs-attr">accepts</span>=<span class="hljs-string">&#x201C;1000&#x201D;</span> <span class="hljs-attr">payload</span>=<span class="hljs-string">&#x201C;8388608&#x201D;</span> /&gt;</span>
</code></pre>
<p><img src="../sources/images/dubbo-protocol.jpg" alt="/user-guide/images/dubbo-protocol.jpg"></p>
<ul>
<li>Transporter: mina, netty, grizzy</li>
<li>Serialization: dubbo, hessian2, java, json</li>
<li>Dispatcher: all, direct, message, execution, connection</li>
<li>ThreadPool: fixed, cached</li>
</ul>
<blockquote>
<p><img src="../sources/images/check.gif" alt="warning">Dubbo&#x534F;&#x8BAE;&#x7F3A;&#x7701;&#x6BCF;&#x670D;&#x52A1;&#x6BCF;&#x63D0;&#x4F9B;&#x8005;&#x6BCF;&#x6D88;&#x8D39;&#x8005;&#x4F7F;&#x7528;&#x5355;&#x4E00;&#x957F;&#x8FDE;&#x63A5;&#xFF0C;&#x5982;&#x679C;&#x6570;&#x636E;&#x91CF;&#x8F83;&#x5927;&#xFF0C;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x591A;&#x4E2A;&#x8FDE;&#x63A5;&#x3002;</p>
</blockquote>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">dubbo:protocol</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;dubbo&quot;</span> <span class="hljs-attr">connections</span>=<span class="hljs-string">&quot;2&quot;</span> /&gt;</span>
</code></pre>
<ul>
<li><code>&lt;dubbo:service connections=&#x201D;0&#x201D;&gt;</code> &#x6216; <code>&lt;dubbo:reference connections=&#x201D;0&#x201D;&gt;</code> &#x8868;&#x793A;&#x8BE5;&#x670D;&#x52A1;&#x4F7F;&#x7528;JVM&#x5171;&#x4EAB;&#x957F;&#x8FDE;&#x63A5;&#x3002;(&#x7F3A;&#x7701;)</li>
<li><code>&lt;dubbo:service connections=&#x201D;1&#x201D;&gt;</code> &#x6216; <code>&lt;dubbo:reference connections=&#x201D;1&#x201D;&gt;</code> &#x8868;&#x793A;&#x8BE5;&#x670D;&#x52A1;&#x4F7F;&#x7528;&#x72EC;&#x7ACB;&#x957F;&#x8FDE;&#x63A5;&#x3002;</li>
<li><code>&lt;dubbo:service connections=&#x201D;2&#x201D;&gt;</code> &#x6216;<code>&lt;dubbo:reference connections=&#x201D;2&#x201D;&gt;</code> &#x8868;&#x793A;&#x8BE5;&#x670D;&#x52A1;&#x4F7F;&#x7528;&#x72EC;&#x7ACB;&#x4E24;&#x6761;&#x957F;&#x8FDE;&#x63A5;&#x3002;</li>
</ul>
<blockquote>
<p><img src="../sources/images/check.gif" alt="warning">&#x4E3A;&#x9632;&#x6B62;&#x88AB;&#x5927;&#x91CF;&#x8FDE;&#x63A5;&#x6491;&#x6302;&#xFF0C;&#x53EF;&#x5728;&#x670D;&#x52A1;&#x63D0;&#x4F9B;&#x65B9;&#x9650;&#x5236;&#x5927;&#x63A5;&#x6536;&#x8FDE;&#x63A5;&#x6570;&#xFF0C;&#x4EE5;&#x5B9E;&#x73B0;&#x670D;&#x52A1;&#x63D0;&#x4F9B;&#x65B9;&#x81EA;&#x6211;&#x4FDD;&#x62A4;&#x3002;</p>
</blockquote>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">dubbo:protocol</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;dubbo&quot;</span> <span class="hljs-attr">accepts</span>=<span class="hljs-string">&quot;1000&quot;</span> /&gt;</span>
</code></pre>
<p>&#x7F3A;&#x7701;&#x534F;&#x8BAE;&#xFF0C;&#x4F7F;&#x7528;&#x57FA;&#x4E8E;mina1.1.7+hessian3.2.1&#x7684;tbremoting&#x4EA4;&#x4E92;&#x3002;</p>
<ul>
<li>&#x8FDE;&#x63A5;&#x4E2A;&#x6570;&#xFF1A;&#x5355;&#x8FDE;&#x63A5;</li>
<li>&#x8FDE;&#x63A5;&#x65B9;&#x5F0F;&#xFF1A;&#x957F;&#x8FDE;&#x63A5;</li>
<li>&#x4F20;&#x8F93;&#x534F;&#x8BAE;&#xFF1A;TCP</li>
<li>&#x4F20;&#x8F93;&#x65B9;&#x5F0F;&#xFF1A;NIO&#x5F02;&#x6B65;&#x4F20;&#x8F93;</li>
<li>&#x5E8F;&#x5217;&#x5316;&#xFF1A;Hessian&#x4E8C;&#x8FDB;&#x5236;&#x5E8F;&#x5217;&#x5316;</li>
<li>&#x9002;&#x7528;&#x8303;&#x56F4;&#xFF1A;&#x4F20;&#x5165;&#x4F20;&#x51FA;&#x53C2;&#x6570;&#x6570;&#x636E;&#x5305;&#x8F83;&#x5C0F;&#xFF08;&#x5EFA;&#x8BAE;&#x5C0F;&#x4E8E;100K&#xFF09;&#xFF0C;&#x6D88;&#x8D39;&#x8005;&#x6BD4;&#x63D0;&#x4F9B;&#x8005;&#x4E2A;&#x6570;&#x591A;&#xFF0C;&#x5355;&#x4E00;&#x6D88;&#x8D39;&#x8005;&#x65E0;&#x6CD5;&#x538B;&#x6EE1;&#x63D0;&#x4F9B;&#x8005;&#xFF0C;&#x5C3D;&#x91CF;&#x4E0D;&#x8981;&#x7528;dubbo&#x534F;&#x8BAE;&#x4F20;&#x8F93;&#x5927;&#x6587;&#x4EF6;&#x6216;&#x8D85;&#x5927;&#x5B57;&#x7B26;&#x4E32;&#x3002;</li>
<li>&#x9002;&#x7528;&#x573A;&#x666F;&#xFF1A;&#x5E38;&#x89C4;&#x8FDC;&#x7A0B;&#x670D;&#x52A1;&#x65B9;&#x6CD5;&#x8C03;&#x7528;</li>
</ul>
<p><strong>&#x4E3A;&#x4EC0;&#x4E48;&#x8981;&#x6D88;&#x8D39;&#x8005;&#x6BD4;&#x63D0;&#x4F9B;&#x8005;&#x4E2A;&#x6570;&#x591A;?</strong></p>
<p>&#x56E0;dubbo&#x534F;&#x8BAE;&#x91C7;&#x7528;&#x5355;&#x4E00;&#x957F;&#x8FDE;&#x63A5;&#xFF0C;&#x5047;&#x8BBE;&#x7F51;&#x7EDC;&#x4E3A;&#x5343;&#x5146;&#x7F51;&#x5361;(1024Mbit=128MByte)&#xFF0C;&#x6839;&#x636E;&#x6D4B;&#x8BD5;&#x7ECF;&#x9A8C;&#x6570;&#x636E;&#x6BCF;&#x6761;&#x8FDE;&#x63A5;&#x6700;&#x591A;&#x53EA;&#x80FD;&#x538B;&#x6EE1;7MByte(&#x4E0D;&#x540C;&#x7684;&#x73AF;&#x5883;&#x53EF;&#x80FD;&#x4E0D;&#x4E00;&#x6837;&#xFF0C;&#x4F9B;&#x53C2;&#x8003;)&#xFF0C;&#x7406;&#x8BBA;&#x4E0A;1&#x4E2A;&#x670D;&#x52A1;&#x63D0;&#x4F9B;&#x8005;&#x9700;&#x8981;20&#x4E2A;&#x670D;&#x52A1;&#x6D88;&#x8D39;&#x8005;&#x624D;&#x80FD;&#x538B;&#x6EE1;&#x7F51;&#x5361;&#x3002;</p>
<p><strong>&#x4E3A;&#x4EC0;&#x4E48;&#x4E0D;&#x80FD;&#x4F20;&#x5927;&#x5305;?</strong></p>
<p>&#x56E0;dubbo&#x534F;&#x8BAE;&#x91C7;&#x7528;&#x5355;&#x4E00;&#x957F;&#x8FDE;&#x63A5;&#xFF0C;&#x5982;&#x679C;&#x6BCF;&#x6B21;&#x8BF7;&#x6C42;&#x7684;&#x6570;&#x636E;&#x5305;&#x5927;&#x5C0F;&#x4E3A;500KByte&#xFF0C;&#x5047;&#x8BBE;&#x7F51;&#x7EDC;&#x4E3A;&#x5343;&#x5146;&#x7F51;&#x5361;(1024Mbit=128MByte)&#xFF0C;&#x6BCF;&#x6761;&#x8FDE;&#x63A5;&#x6700;&#x5927;7MByte(&#x4E0D;&#x540C;&#x7684;&#x73AF;&#x5883;&#x53EF;&#x80FD;&#x4E0D;&#x4E00;&#x6837;&#xFF0C;&#x4F9B;&#x53C2;&#x8003;)&#xFF0C;&#x5355;&#x4E2A;&#x670D;&#x52A1;&#x63D0;&#x4F9B;&#x8005;&#x7684;TPS(&#x6BCF;&#x79D2;&#x5904;&#x7406;&#x4E8B;&#x52A1;&#x6570;)&#x6700;&#x5927;&#x4E3A;&#xFF1A;128MByte / 500KByte = 262&#x3002;&#x5355;&#x4E2A;&#x6D88;&#x8D39;&#x8005;&#x8C03;&#x7528;&#x5355;&#x4E2A;&#x670D;&#x52A1;&#x63D0;&#x4F9B;&#x8005;&#x7684;TPS(&#x6BCF;&#x79D2;&#x5904;&#x7406;&#x4E8B;&#x52A1;&#x6570;)&#x6700;&#x5927;&#x4E3A;&#xFF1A;7MByte / 500KByte = 14&#x3002;&#x5982;&#x679C;&#x80FD;&#x63A5;&#x53D7;&#xFF0C;&#x53EF;&#x4EE5;&#x8003;&#x8651;&#x4F7F;&#x7528;&#xFF0C;&#x5426;&#x5219;&#x7F51;&#x7EDC;&#x5C06;&#x6210;&#x4E3A;&#x74F6;&#x9888;&#x3002;</p>
<p><strong>&#x4E3A;&#x4EC0;&#x4E48;&#x91C7;&#x7528;&#x5F02;&#x6B65;&#x5355;&#x4E00;&#x957F;&#x8FDE;&#x63A5;?</strong></p>
<p>&#x56E0;&#x4E3A;&#x670D;&#x52A1;&#x7684;&#x73B0;&#x72B6;&#x5927;&#x90FD;&#x662F;&#x670D;&#x52A1;&#x63D0;&#x4F9B;&#x8005;&#x5C11;&#xFF0C;&#x901A;&#x5E38;&#x53EA;&#x6709;&#x51E0;&#x53F0;&#x673A;&#x5668;&#xFF0C;&#x800C;&#x670D;&#x52A1;&#x7684;&#x6D88;&#x8D39;&#x8005;&#x591A;&#xFF0C;&#x53EF;&#x80FD;&#x6574;&#x4E2A;&#x7F51;&#x7AD9;&#x90FD;&#x5728;&#x8BBF;&#x95EE;&#x8BE5;&#x670D;&#x52A1;&#xFF0C;&#x6BD4;&#x5982;Morgan&#x7684;&#x63D0;&#x4F9B;&#x8005;&#x53EA;&#x6709;6&#x53F0;&#x63D0;&#x4F9B;&#x8005;&#xFF0C;&#x5374;&#x6709;&#x4E0A;&#x767E;&#x53F0;&#x6D88;&#x8D39;&#x8005;&#xFF0C;&#x6BCF;&#x5929;&#x6709;1.5&#x4EBF;&#x6B21;&#x8C03;&#x7528;&#xFF0C;&#x5982;&#x679C;&#x91C7;&#x7528;&#x5E38;&#x89C4;&#x7684;hessian&#x670D;&#x52A1;&#xFF0C;&#x670D;&#x52A1;&#x63D0;&#x4F9B;&#x8005;&#x5F88;&#x5BB9;&#x6613;&#x5C31;&#x88AB;&#x538B;&#x8DE8;&#xFF0C;&#x901A;&#x8FC7;&#x5355;&#x4E00;&#x8FDE;&#x63A5;&#xFF0C;&#x4FDD;&#x8BC1;&#x5355;&#x4E00;&#x6D88;&#x8D39;&#x8005;&#x4E0D;&#x4F1A;&#x538B;&#x6B7B;&#x63D0;&#x4F9B;&#x8005;&#xFF0C;&#x957F;&#x8FDE;&#x63A5;&#xFF0C;&#x51CF;&#x5C11;&#x8FDE;&#x63A5;&#x63E1;&#x624B;&#x9A8C;&#x8BC1;&#x7B49;&#xFF0C;&#x5E76;&#x4F7F;&#x7528;&#x5F02;&#x6B65;IO&#xFF0C;&#x590D;&#x7528;&#x7EBF;&#x7A0B;&#x6C60;&#xFF0C;&#x9632;&#x6B62;C10K&#x95EE;&#x9898;&#x3002;</p>
<p>(1) &#x7EA6;&#x675F;&#xFF1A;</p>
<ul>
<li>&#x53C2;&#x6570;&#x53CA;&#x8FD4;&#x56DE;&#x503C;&#x9700;&#x5B9E;&#x73B0;Serializable&#x63A5;&#x53E3;</li>
<li>&#x53C2;&#x6570;&#x53CA;&#x8FD4;&#x56DE;&#x503C;&#x4E0D;&#x80FD;&#x81EA;&#x5B9A;&#x4E49;&#x5B9E;&#x73B0;List, Map, Number, Date, Calendar&#x7B49;&#x63A5;&#x53E3;&#xFF0C;&#x53EA;&#x80FD;&#x7528;JDK&#x81EA;&#x5E26;&#x7684;&#x5B9E;&#x73B0;&#xFF0C;&#x56E0;&#x4E3A;hessian&#x4F1A;&#x505A;&#x7279;&#x6B8A;&#x5904;&#x7406;&#xFF0C;&#x81EA;&#x5B9A;&#x4E49;&#x5B9E;&#x73B0;&#x7C7B;&#x4E2D;&#x7684;&#x5C5E;&#x6027;&#x503C;&#x90FD;&#x4F1A;&#x4E22;&#x5931;&#x3002;</li>
<li><p>Hessian&#x5E8F;&#x5217;&#x5316;&#xFF0C;&#x53EA;&#x4F20;&#x6210;&#x5458;&#x5C5E;&#x6027;&#x503C;&#x548C;&#x503C;&#x7684;&#x7C7B;&#x578B;&#xFF0C;&#x4E0D;&#x4F20;&#x65B9;&#x6CD5;&#x6216;&#x9759;&#x6001;&#x53D8;&#x91CF;&#xFF0C;&#x517C;&#x5BB9;&#x60C5;&#x51B5;&#xFF1A;(&#x7531;&#x5434;&#x4E9A;&#x519B;&#x63D0;&#x4F9B;)</p>
<p> &#x6570;&#x636E;&#x901A;&#x8BAF; | &#x60C5;&#x51B5; | &#x7ED3;&#x679C;
------------- | ------------- | -------------
A-&gt;B | &#x7C7B;A&#x591A;&#x4E00;&#x79CD; &#x5C5E;&#x6027;&#xFF08;&#x6216;&#x8005;&#x8BF4;&#x7C7B;B&#x5C11;&#x4E00;&#x79CD; &#x5C5E;&#x6027;&#xFF09;| &#x4E0D;&#x629B;&#x5F02;&#x5E38;&#xFF0C;A&#x591A;&#x7684;&#x90A3; &#x4E2A;&#x5C5E;&#x6027;&#x7684;&#x503C;&#xFF0C;B&#x6CA1;&#x6709;&#xFF0C; &#x5176;&#x4ED6;&#x6B63;&#x5E38;
A-&gt;B | &#x679A;&#x4E3E;A&#x591A;&#x4E00;&#x79CD; &#x679A;&#x4E3E;&#xFF08;&#x6216;&#x8005;&#x8BF4;B&#x5C11;&#x4E00;&#x79CD; &#x679A;&#x4E3E;&#xFF09;&#xFF0C;A&#x4F7F;&#x7528;&#x591A; &#x51FA;&#x6765;&#x7684;&#x679A;&#x4E3E;&#x8FDB;&#x884C;&#x4F20;&#x8F93; | &#x629B;&#x5F02;&#x5E38;
A-&gt;B | &#x679A;&#x4E3E;A&#x591A;&#x4E00;&#x79CD; &#x679A;&#x4E3E;&#xFF08;&#x6216;&#x8005;&#x8BF4;B&#x5C11;&#x4E00;&#x79CD; &#x679A;&#x4E3E;&#xFF09;&#xFF0C;A&#x4E0D;&#x4F7F;&#x7528; &#x591A;&#x51FA;&#x6765;&#x7684;&#x679A;&#x4E3E;&#x8FDB;&#x884C;&#x4F20;&#x8F93; | &#x4E0D;&#x629B;&#x5F02;&#x5E38;&#xFF0C;B&#x6B63;&#x5E38;&#x63A5; &#x6536;&#x6570;&#x636E;
A-&gt;B | A&#x548C;B&#x7684;&#x5C5E;&#x6027; &#x540D;&#x76F8;&#x540C;&#xFF0C;&#x4F46;&#x7C7B;&#x578B;&#x4E0D;&#x76F8;&#x540C; | &#x629B;&#x5F02;&#x5E38;
A-&gt;B | serialId &#x4E0D;&#x76F8;&#x540C; | &#x6B63;&#x5E38;&#x4F20;&#x8F93;</p>
<p> &#x603B;&#x7ED3;&#xFF1A;&#x4F1A;&#x629B;&#x5F02;&#x5E38;&#x7684;&#x60C5;&#x51B5;&#xFF1A;&#x679A;&#x4E3E;&#x503C;&#x4E00;&#x8FB9;&#x591A;&#x4E00;&#x79CD;&#xFF0C;&#x4E00;&#x8FB9;&#x5C11;&#x4E00;&#x79CD;&#xFF0C;&#x6B63;&#x597D;&#x4F7F;&#x7528;&#x4E86;&#x5DEE;&#x522B;&#x7684;&#x90A3;&#x79CD;&#xFF0C;&#x6216;&#x8005;&#x5C5E;&#x6027;&#x540D;&#x76F8;&#x540C;&#xFF0C;&#x7C7B;&#x578B;&#x4E0D;&#x540C;</p>
</li>
</ul>
<p>&#x63A5;&#x53E3;&#x589E;&#x52A0;&#x65B9;&#x6CD5;&#xFF0C;&#x5BF9;&#x5BA2;&#x6237;&#x7AEF;&#x65E0;&#x5F71;&#x54CD;&#xFF0C;&#x5982;&#x679C;&#x8BE5;&#x65B9;&#x6CD5;&#x4E0D;&#x662F;&#x5BA2;&#x6237;&#x7AEF;&#x9700;&#x8981;&#x7684;&#xFF0C;&#x5BA2;&#x6237;&#x7AEF;&#x4E0D;&#x9700;&#x8981;&#x91CD;&#x65B0;&#x90E8;&#x7F72;&#x3002;&#x8F93;&#x5165;&#x53C2;&#x6570;&#x548C;&#x7ED3;&#x679C;&#x96C6;&#x4E2D;&#x589E;&#x52A0;&#x5C5E;&#x6027;&#xFF0C;&#x5BF9;&#x5BA2;&#x6237;&#x7AEF;&#x65E0;&#x5F71;&#x54CD;&#xFF0C;&#x5982;&#x679C;&#x5BA2;&#x6237;&#x7AEF;&#x5E76;&#x4E0D;&#x9700;&#x8981;&#x65B0;&#x5C5E;&#x6027;&#xFF0C;&#x4E0D;&#x7528;&#x91CD;&#x65B0;&#x90E8;&#x7F72;&#x3002;</p>
<p>&#x8F93;&#x5165;&#x53C2;&#x6570;&#x548C;&#x7ED3;&#x679C;&#x96C6;&#x5C5E;&#x6027;&#x540D;&#x53D8;&#x5316;&#xFF0C;&#x5BF9;&#x5BA2;&#x6237;&#x7AEF;&#x5E8F;&#x5217;&#x5316;&#x65E0;&#x5F71;&#x54CD;&#xFF0C;&#x4F46;&#x662F;&#x5982;&#x679C;&#x5BA2;&#x6237;&#x7AEF;&#x4E0D;&#x91CD;&#x65B0;&#x90E8;&#x7F72;&#xFF0C;&#x4E0D;&#x7BA1;&#x8F93;&#x5165;&#x8FD8;&#x662F;&#x8F93;&#x51FA;&#xFF0C;&#x5C5E;&#x6027;&#x540D;&#x53D8;&#x5316;&#x7684;&#x5C5E;&#x6027;&#x503C;&#x662F;&#x83B7;&#x53D6;&#x4E0D;&#x5230;&#x7684;&#x3002;</p>
<p>&#x603B;&#x7ED3;&#xFF1A;&#x670D;&#x52A1;&#x5668;&#x7AEF;&#x548C;&#x5BA2;&#x6237;&#x7AEF;&#x5BF9;&#x9886;&#x57DF;&#x5BF9;&#x8C61;&#x5E76;&#x4E0D;&#x9700;&#x8981;&#x5B8C;&#x5168;&#x4E00;&#x81F4;&#xFF0C;&#x800C;&#x662F;&#x6309;&#x7167;&#x6700;&#x5927;&#x5339;&#x914D;&#x539F;&#x5219;&#x3002;</p>
<p>(2) &#x914D;&#x7F6E;&#xFF1A;</p>
<p><strong>dubbo.properties</strong></p>
<pre><code class="lang-sh">dubbo.service.protocol=dubbo
</code></pre>
</section>
</div>
<div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="introduction.html" class="navigation navigation-prev " aria-label="Previous page: 7 协议参考手册">
<i class="fa fa-angle-left"></i>
</a>
<a href="rmi.html" class="navigation navigation-next " aria-label="Next page: 7.2 rmi//">
<i class="fa fa-angle-right"></i>
</a>
</div>
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"7.1 dubbo://","level":"1.8.1","depth":2,"next":{"title":"7.2 rmi//","level":"1.8.2","depth":2,"path":"reference-protocol/rmi.md","ref":"reference-protocol/rmi.md","articles":[]},"previous":{"title":"7 协议参考手册","level":"1.8","depth":1,"path":"reference-protocol/introduction.md","ref":"reference-protocol/introduction.md","articles":[{"title":"7.1 dubbo://","level":"1.8.1","depth":2,"path":"reference-protocol/dubbo.md","ref":"reference-protocol/dubbo.md","articles":[]},{"title":"7.2 rmi//","level":"1.8.2","depth":2,"path":"reference-protocol/rmi.md","ref":"reference-protocol/rmi.md","articles":[]},{"title":"7.3 hessian://","level":"1.8.3","depth":2,"path":"reference-protocol/hessian.md","ref":"reference-protocol/hessian.md","articles":[]},{"title":"7.4 http://","level":"1.8.4","depth":2,"path":"reference-protocol/http.md","ref":"reference-protocol/http.md","articles":[]},{"title":"7.5 webservice://","level":"1.8.5","depth":2,"path":"reference-protocol/webservice.md","ref":"reference-protocol/webservice.md","articles":[]},{"title":"7.6 thrift://","level":"1.8.6","depth":2,"path":"reference-protocol/thrift.md","ref":"reference-protocol/thrift.md","articles":[]},{"title":"7.7 memcached://","level":"1.8.7","depth":2,"path":"reference-protocol/memcached.md","ref":"reference-protocol/memcached.md","articles":[]},{"title":"7.8 redis://","level":"1.8.8","depth":2,"path":"reference-protocol/redis.md","ref":"reference-protocol/redis.md","articles":[]}]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"reference-protocol/dubbo.md","mtime":"2017-08-02T06:13:38.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-08-02T07:36:36.721Z"},"basePath":"..","book":{"language":""}});
});
</script>
</div>
<script src="../gitbook/gitbook.js"></script>
<script src="../gitbook/theme.js"></script>
<script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
<script src="../gitbook/gitbook-plugin-search/search.js"></script>
<script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
<script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
<script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
<script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
</body>
</html>