You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by hu...@apache.org on 2018/08/02 07:09:12 UTC
[incubator-dubbo-website] branch asf-site updated (676dc3c ->
52e8034)
This is an automated email from the ASF dual-hosted git repository.
huxing pushed a change to branch asf-site
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo-website.git.
from 676dc3c Modify the description of the config of the property of protocol (#64)
new 810a3fc Add qos blog.
new 52e8034 Docsite build.
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
blog/zh-cn/introduction-to-dubbo-qos.md | 254 +++++++++++++++++++++
...21b5b839e35d7645.js => 0b0bbf419be1d7b49571.js} | 4 +-
...49b0df42936a8154.js => 1cb17ba6acec73c8197d.js} | 2 +-
...7c0d7caf73d7e493.js => 2796ed1d026d7ba627aa.js} | 0
...c8f549ca85ddd35b.js => 49955d02abb36f898304.js} | 2 +-
...e76506a1ddd84a4b.js => de65f8eca3ff7556b8db.js} | 0
build/page.js | 2 +-
img/blog/qos-architecture.png | Bin 0 -> 30670 bytes
md_json/blog.json | 4 +
md_json/docs.json | 4 +-
site_config/blog.js | 7 +
11 files changed, 272 insertions(+), 7 deletions(-)
create mode 100644 blog/zh-cn/introduction-to-dubbo-qos.md
rename build/{ed8021b5b839e35d7645.js => 0b0bbf419be1d7b49571.js} (52%)
rename build/{a1bf49b0df42936a8154.js => 1cb17ba6acec73c8197d.js} (79%)
rename build/{87c67c0d7caf73d7e493.js => 2796ed1d026d7ba627aa.js} (100%)
rename build/{8a5dc8f549ca85ddd35b.js => 49955d02abb36f898304.js} (55%)
rename build/{197de76506a1ddd84a4b.js => de65f8eca3ff7556b8db.js} (100%)
create mode 100644 img/blog/qos-architecture.png
[incubator-dubbo-website] 02/02: Docsite build.
Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
huxing pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo-website.git
commit 52e803449d7cab72d4cbcc5010b1f29ed377039d
Author: Huxing Zhang <hu...@gmail.com>
AuthorDate: Thu Aug 2 15:08:55 2018 +0800
Docsite build.
---
build/{ed8021b5b839e35d7645.js => 0b0bbf419be1d7b49571.js} | 4 ++--
build/{a1bf49b0df42936a8154.js => 1cb17ba6acec73c8197d.js} | 2 +-
build/{87c67c0d7caf73d7e493.js => 2796ed1d026d7ba627aa.js} | 0
build/{8a5dc8f549ca85ddd35b.js => 49955d02abb36f898304.js} | 2 +-
build/{197de76506a1ddd84a4b.js => de65f8eca3ff7556b8db.js} | 0
build/page.js | 2 +-
md_json/docs.json | 4 ++--
7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/build/ed8021b5b839e35d7645.js b/build/0b0bbf419be1d7b49571.js
similarity index 52%
rename from build/ed8021b5b839e35d7645.js
rename to build/0b0bbf419be1d7b49571.js
index a0e1754..c94f059 100644
--- a/build/ed8021b5b839e35d7645.js
+++ b/build/0b0bbf419be1d7b49571.js
@@ -1,6 +1,6 @@
-webpackJsonp([1],[,,,,,,,,function(s,n,a){"use strict";function e(s){return s&&s.__esModule?s:{default:s}}function t(s,n){if(!(s instanceof n))throw new TypeError("Cannot call a class as a function")}function l(s,n){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?s:n}function o(s,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+ [...]
+webpackJsonp([1],[,,,,,,,,function(s,n,a){"use strict";function e(s){return s&&s.__esModule?s:{default:s}}function t(s,n){if(!(s instanceof n))throw new TypeError("Cannot call a class as a function")}function l(s,n){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?s:n}function o(s,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+ [...]
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
-!function(){"use strict";function a(){for(var s=[],n=0;n<arguments.length;n++){var e=arguments[n];if(e){var t=typeof e;if("string"===t||"number"===t)s.push(e);else if(Array.isArray(e))s.push(a.apply(null,e));else if("object"===t)for(var o in e)l.call(e,o)&&e[o]&&s.push(o)}}return s.join(" ")}var l={}.hasOwnProperty;void 0!==s&&s.exports?s.exports=a:(e=[],void 0!==(t=function(){return a}.apply(n,e))&&(s.exports=t))}()},function(s,n,a){"use strict";function e(s,n,e){var t=e.configurable,p= [...]
\ No newline at end of file
+!function(){"use strict";function a(){for(var s=[],n=0;n<arguments.length;n++){var e=arguments[n];if(e){var t=typeof e;if("string"===t||"number"===t)s.push(e);else if(Array.isArray(e))s.push(a.apply(null,e));else if("object"===t)for(var o in e)l.call(e,o)&&e[o]&&s.push(o)}}return s.join(" ")}var l={}.hasOwnProperty;void 0!==s&&s.exports?s.exports=a:(e=[],void 0!==(t=function(){return a}.apply(n,e))&&(s.exports=t))}()},function(s,n,a){"use strict";function e(s,n,e){var t=e.configurable,p= [...]
\ No newline at end of file
diff --git a/build/a1bf49b0df42936a8154.js b/build/1cb17ba6acec73c8197d.js
similarity index 79%
rename from build/a1bf49b0df42936a8154.js
rename to build/1cb17ba6acec73c8197d.js
index 544ded0..2b2ff4b 100644
--- a/build/a1bf49b0df42936a8154.js
+++ b/build/1cb17ba6acec73c8197d.js
@@ -3,4 +3,4 @@ webpackJsonp([4],[,,,,,,,function(e,t,n){"use strict";function r(e){return e&&e.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
-!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r))e.push(n.apply(null,r));else if("object"===o)for(var a in r)i.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}var i={}.hasOwnProperty;void 0!==e&&e.exports?e.exports=n:(r=[],void 0!==(o=function(){return n}.apply(t,r))&&(e.exports=o))}()},function(e,t,n){"use strict";function r(e,t,r){var o=r.configurable,l= [...]
\ No newline at end of file
+!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r))e.push(n.apply(null,r));else if("object"===o)for(var a in r)i.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}var i={}.hasOwnProperty;void 0!==e&&e.exports?e.exports=n:(r=[],void 0!==(o=function(){return n}.apply(t,r))&&(e.exports=o))}()},function(e,t,n){"use strict";function r(e,t,r){var o=r.configurable,l= [...]
\ No newline at end of file
diff --git a/build/87c67c0d7caf73d7e493.js b/build/2796ed1d026d7ba627aa.js
similarity index 100%
rename from build/87c67c0d7caf73d7e493.js
rename to build/2796ed1d026d7ba627aa.js
diff --git a/build/8a5dc8f549ca85ddd35b.js b/build/49955d02abb36f898304.js
similarity index 55%
rename from build/8a5dc8f549ca85ddd35b.js
rename to build/49955d02abb36f898304.js
index 86a71d1..ca38086 100644
--- a/build/8a5dc8f549ca85ddd35b.js
+++ b/build/49955d02abb36f898304.js
@@ -3,4 +3,4 @@ webpackJsonp([0],[,,,,,,,,,,function(s,n,a){"use strict";function e(s){return s&
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
-!function(){"use strict";function a(){for(var s=[],n=0;n<arguments.length;n++){var e=arguments[n];if(e){var t=typeof e;if("string"===t||"number"===t)s.push(e);else if(Array.isArray(e))s.push(a.apply(null,e));else if("object"===t)for(var o in e)l.call(e,o)&&e[o]&&s.push(o)}}return s.join(" ")}var l={}.hasOwnProperty;void 0!==s&&s.exports?s.exports=a:(e=[],void 0!==(t=function(){return a}.apply(n,e))&&(s.exports=t))}()},function(s,n,a){"use strict";function e(s,n,e){var t=e.configurable,r= [...]
\ No newline at end of file
+!function(){"use strict";function a(){for(var s=[],n=0;n<arguments.length;n++){var e=arguments[n];if(e){var t=typeof e;if("string"===t||"number"===t)s.push(e);else if(Array.isArray(e))s.push(a.apply(null,e));else if("object"===t)for(var o in e)l.call(e,o)&&e[o]&&s.push(o)}}return s.join(" ")}var l={}.hasOwnProperty;void 0!==s&&s.exports?s.exports=a:(e=[],void 0!==(t=function(){return a}.apply(n,e))&&(s.exports=t))}()},function(s,n,a){"use strict";function e(s,n,e){var t=e.configurable,r= [...]
\ No newline at end of file
diff --git a/build/197de76506a1ddd84a4b.js b/build/de65f8eca3ff7556b8db.js
similarity index 100%
rename from build/197de76506a1ddd84a4b.js
rename to build/de65f8eca3ff7556b8db.js
diff --git a/build/page.js b/build/page.js
index 83ff1da..b91cc45 100644
--- a/build/page.js
+++ b/build/page.js
@@ -1 +1 @@
-!function(n){function o(t){if(e[t])return e[t].exports;var r=e[t]={i:t,l:!1,exports:{}};return n[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}var t=window.webpackJsonp;window.webpackJsonp=function(o,e,a){for(var i,d,l=0,c=[];l<o.length;l++)d=o[l],r[d]&&c.push(r[d][0]),r[d]=0;for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);for(t&&t(o,e,a);c.length;)c.shift()()};var e={},r={5:0};o.e=function(n){function t(){d.onerror=d.onload=null,clearTimeout(l);var o=r[n];0!==o&&(o [...]
\ No newline at end of file
+!function(n){function o(t){if(e[t])return e[t].exports;var r=e[t]={i:t,l:!1,exports:{}};return n[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}var t=window.webpackJsonp;window.webpackJsonp=function(o,e,a){for(var i,d,l=0,c=[];l<o.length;l++)d=o[l],r[d]&&c.push(r[d][0]),r[d]=0;for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);for(t&&t(o,e,a);c.length;)c.shift()()};var e={},r={5:0};o.e=function(n){function t(){d.onerror=d.onload=null,clearTimeout(l);var o=r[n];0!==o&&(o [...]
\ No newline at end of file
diff --git a/md_json/docs.json b/md_json/docs.json
index d9a8a84..93ea2b2 100644
--- a/md_json/docs.json
+++ b/md_json/docs.json
@@ -626,7 +626,7 @@
},
{
"filename": "user/references/xml/dubbo-protocol.md",
- "__html": "<style>\ntable {\n width: 100%;\n max-width: 65em;\n border: 1px solid #dedede;\n margin: 15px auto;\n border-collapse: collapse;\n empty-cells: show;\n}\ntable th,\ntable td {\n height: 35px;\n border: 1px solid #dedede;\n padding: 0 10px;\n}\ntable th {\n font-weight: bold;\n text-align: center !important;\n background: rgba(158,188,226,0.2);\n white-space: nowrap;\n}\ntable tbody tr:nth-child(2n) {\n background: rgba(158,188,226,0.12);\n}\ntable td:nth-c [...]
+ "__html": "<style>\ntable {\n width: 100%;\n max-width: 65em;\n border: 1px solid #dedede;\n margin: 15px auto;\n border-collapse: collapse;\n empty-cells: show;\n}\ntable th,\ntable td {\n height: 35px;\n border: 1px solid #dedede;\n padding: 0 10px;\n}\ntable th {\n font-weight: bold;\n text-align: center !important;\n background: rgba(158,188,226,0.2);\n white-space: nowrap;\n}\ntable tbody tr:nth-child(2n) {\n background: rgba(158,188,226,0.12);\n}\ntable td:nth-c [...]
},
{
"filename": "user/references/xml/dubbo-provider.md",
@@ -1244,7 +1244,7 @@
},
{
"filename": "user/references/xml/dubbo-protocol.md",
- "__html": "<style>\ntable {\n width: 100%;\n max-width: 65em;\n border: 1px solid #dedede;\n margin: 15px auto;\n border-collapse: collapse;\n empty-cells: show;\n}\ntable th,\ntable td {\n height: 35px;\n border: 1px solid #dedede;\n padding: 0 10px;\n}\ntable th {\n font-weight: bold;\n text-align: center !important;\n background: rgba(158,188,226,0.2);\n white-space: nowrap;\n}\ntable tbody tr:nth-child(2n) {\n background: rgba(158,188,226,0.12);\n}\ntable td:nth-c [...]
+ "__html": "<style>\ntable {\n width: 100%;\n max-width: 65em;\n border: 1px solid #dedede;\n margin: 15px auto;\n border-collapse: collapse;\n empty-cells: show;\n}\ntable th,\ntable td {\n height: 35px;\n border: 1px solid #dedede;\n padding: 0 10px;\n}\ntable th {\n font-weight: bold;\n text-align: center !important;\n background: rgba(158,188,226,0.2);\n white-space: nowrap;\n}\ntable tbody tr:nth-child(2n) {\n background: rgba(158,188,226,0.12);\n}\ntable td:nth-c [...]
},
{
"filename": "user/references/xml/dubbo-provider.md",
[incubator-dubbo-website] 01/02: Add qos blog.
Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
huxing pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo-website.git
commit 810a3fc60802d709441dbabf08c30d1bd2cc9c4e
Author: Huxing Zhang <hu...@gmail.com>
AuthorDate: Thu Aug 2 12:49:55 2018 +0800
Add qos blog.
---
blog/zh-cn/introduction-to-dubbo-qos.md | 254 ++++++++++++++++++++++++++++++++
img/blog/qos-architecture.png | Bin 0 -> 30670 bytes
md_json/blog.json | 4 +
site_config/blog.js | 7 +
4 files changed, 265 insertions(+)
diff --git a/blog/zh-cn/introduction-to-dubbo-qos.md b/blog/zh-cn/introduction-to-dubbo-qos.md
new file mode 100644
index 0000000..ea11a1e
--- /dev/null
+++ b/blog/zh-cn/introduction-to-dubbo-qos.md
@@ -0,0 +1,254 @@
+# 通过QoS对服务进行动态控制
+
+
+QoS,全称为`Quality of Service`, 是常见于网络设备中的一个术语 ,例如在路由器中,可以通过Qos动态的调整和控制某些端口的权重,从优先的保障运行在这些端口上的服务质量。
+
+在Dubbo中,QoS这个概念被用于动态的对服务进行查询和控制。例如对获取当前提供和消费的所有服务,以及对服务进行动态的上下线,即从注册中心上进行注册和反注册操作。
+
+### QoS工作机制
+
+从Dubbo 2.5.8开始,默认引入了Qos功能,默认处于启动状态。所有的QoS功能被抽象成一个个的命令,通过执行这些命令,Qos会返回响应的结果。
+
+> Qos功能基于Netty4实现,在Dubbo 2.6.x之前的版本中,默认依赖的是Netty3,因此需要显示的添加Netty4的依赖,才能确保Netty4正常工作。如果使用http://start.dubbo.io自动生成的Dubbo应用,则无需添加额外的配置,因为已经默认加上了Netty4的依赖。
+
+Qos的工作机制如下图所示:
+
+
+
+
+
+1. 启动并监听一个端口,默认端口是22222
+2. 识别目标请求的协议是Http或者是Telnet,根据协议不同动态添加对应的处理器
+3. 针对不同的协议进行解码,解析出需要执行的命令
+4. 执行命令并返回结果
+
+### QoS命令
+
+QoS目前支持的命令包括:
+
+* help: 帮助命令,列出
+* ls: 列出当前所有的正在提供的服务,以及消费的服务
+* online: 动态将某个或全部服务向注册中心进行注册
+* offline: 动态将某个或全部服务从注册中心摘除(反注册)
+* quit: 退出当前telnet会话
+
+下面,我们具体来操作一下如何通过用QoS对服务进行动态控制。
+
+#### 通过Telnet方式访问QoS
+
+假设我们的Dubbo服务端已经启动,我们通过Telnet方式进行连接:
+
+```
+$ telnet localhost 22222
+Trying 127.0.0.1...
+Connected to localhost.
+Escape character is '^]'.
+ ????????? ??? ?? ??????????? ??????????? ????????
+ ??? ???? ??? ??? ??? ??? ??? ??? ??? ???
+ ??? ??? ??? ??? ??? ??? ??? ??? ??? ???
+ ??? ??? ??? ??? ?????????? ?????????? ??? ???
+ ??? ??? ??? ??? ??????????? ??????????? ??? ???
+ ??? ??? ??? ??? ??? ??? ??? ??? ??? ???
+ ??? ???? ??? ??? ??? ??? ??? ??? ??? ???
+ ????????? ????????? ??????????? ??????????? ????????
+
+
+dubbo>
+```
+
+连接成功后,会出现`dubbo>`提示符,此时输入`help`命令
+
+```
+dubbo>help
++---------+----------------------------------------------------------------------------------+
+| help | help command |
++---------+----------------------------------------------------------------------------------+
+| ls | ls service |
++---------+----------------------------------------------------------------------------------+
+| offline | offline dubbo |
++---------+----------------------------------------------------------------------------------+
+| online | online dubbo |
++---------+----------------------------------------------------------------------------------+
+| quit | quit telnet console |
++---------+----------------------------------------------------------------------------------+
+
+dubbo>
+```
+
+会列出当前所有可用的命令,及相应的说明。
+
+也可以对单个命令进行help操作,可以看到该命令对应的示例
+
+```
+dubbo>help online
++--------------+----------------------------------------------------------------------------------+
+| COMMAND NAME | online |
++--------------+----------------------------------------------------------------------------------+
+| EXAMPLE | online dubbo |
+| | online xx.xx.xxx.service |
++--------------+----------------------------------------------------------------------------------+
+```
+
+通过`ls` 查看当前的服务状态
+
+```
+dubbo>ls
+As Provider side:
++------------------------------------------+---+
+| Provider Service Name |PUB|
++------------------------------------------+---+
+|org.apache.dubbo.demo.provider.DemoService| Y |
++------------------------------------------+---+
+As Consumer side:
++---------------------+---+
+|Consumer Service Name|NUM|
++---------------------+---+
+```
+
+可以看到,在服务端可以看到一个服务`org.apache.dubbo.demo.provider.DemoService`,第二列里面的`PUB=Y`代表改服务已经发布到注册中心,可供消费端进行调用。
+
+假设我们需要动态的对该服务进行下线操作,可以通过`offline`命令来完成
+
+```
+dubbo>offline org.apache.dubbo.demo.provider.DemoService
+OK
+```
+
+可以看到命令返回了OK,我们再通过ls看下当前的状态:
+
+```
+dubbo>ls
+As Provider side:
++------------------------------------------+---+
+| Provider Service Name |PUB|
++------------------------------------------+---+
+|org.apache.dubbo.demo.provider.DemoService| N |
++------------------------------------------+---+
+As Consumer side:
++---------------------+---+
+|Consumer Service Name|NUM|
++---------------------+---+
+```
+
+可以看到`org.apache.dubbo.demo.provider.DemoService`的`PUB`已经被设置成了`N`。
+
+通过`quit`命令退出当前的telnet会话:
+
+```
+dubbo>quit
+BYE!
+Connection closed by foreign host.
+```
+
+
+
+#### 通过HTTP方式访问QOS
+
+在上面的例子中,我们已经对`org.apache.dubbo.demo.provider.DemoService`进行了下线操作,下面,我们通过对Http方式对上面的服务进行注册操作:
+
+```
+$ curl -i http://localhost:22222/online?service=org.apache.dubbo.demo.provider.DemoService
+HTTP/1.1 200 OK
+Content-Type: text/plain
+Content-Length: 2
+
+OK%
+```
+
+> 注意online操作对应的参数,需要以`key=value`的形式提供,但实际上key会被忽略
+
+看到操作返回了OK,下面通过ls命令查看下当前的状态
+
+```
+$ curl -i http://localhost:22222/ls
+HTTP/1.1 200 OK
+Content-Type: text/plain
+Content-Length: 365
+
+As Provider side:
++------------------------------------------+---+
+| Provider Service Name |PUB|
++------------------------------------------+---+
+|org.apache.dubbo.demo.provider.DemoService| Y |
++------------------------------------------+---+
+As Consumer side:
++---------------------+---+
+|Consumer Service Name|NUM|
++---------------------+---+
+```
+
+可以看到服务的`PUB`状态已经变成了`Y`。
+
+
+
+### QoS相关参数说明
+
+QoS提供了一些启动参数,来对启动进行配置,他们主要包括:
+
+| 参数 | 说明 | 默认值 |
+| ------------------ | ----------------- | ------ |
+| qosEnable | 是否启动QoS | true |
+| qosPort | 启动QoS绑定的端口 | 22222 |
+| qosAcceptForeignIp | 是否允许远程访问 | false |
+
+> 注意,从2.6.4/2.7.0开始,qosAcceptForeignIp默认配置改为false,如果qosAcceptForeignIp设置为true,有可能带来安全风险,请仔细评估后再打开。
+
+QoS参数可以通过如下方式进行配置
+
+* 系统属性
+* dubbo.properties
+* XML方式
+* Spring-boot自动装配方式
+
+其中,上述方式的优先顺序为系统属性 > dubbo.properties > XML/Spring-boot自动装配方式。
+
+#### 使用系统属性方式进行配置
+
+```
+-Ddubbo.application.qos.enable=true
+-Ddubbo.application.qos.port=33333
+-Ddubbo.application.qos.accept.foreign.ip=false
+```
+
+#### 使用dubbo.properties文件进行配置
+
+在项目的`src/main/resources`目录下添加dubbo.properties文件,内容如下:
+```
+dubbo.application.qos.enable=true
+dubbo.application.qos.port=33333
+dubbo.application.qos.accept.foreign.ip=false
+```
+
+#### 使用XML方法进行配置
+
+如果要通过XML配置响应的QoS相关的参数,可以进行如下配置:
+
+```xml
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:dubbo="http://dubbo.apache.org/schema/dubbo"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd">
+ <dubbo:application name="demo-provider">
+ <dubbo:parameter key="qos.enable" value="true"/>
+ <dubbo:parameter key="qos.accept.foreign.ip" value="false"/>
+ <dubbo:parameter key="qos.port" value="33333"/>
+ </dubbo:application>
+ <dubbo:registry address="multicast://224.5.6.7:1234"/>
+ <dubbo:protocol name="dubbo" port="20880"/>
+ <dubbo:service interface="org.apache.dubbo.demo.provider.DemoService" ref="demoService"/>
+ <bean id="demoService" class="org.apache.dubbo.demo.provider.DemoServiceImpl"/>
+</beans>
+```
+
+#### 使用spring-boot自动装配方式配置
+
+如果是spring-boot的应用,可以在`application.properties`或者`application.yml`上配置:
+
+```
+dubbo.application.qosEnable=true
+dubbo.application.qosPort=33333
+dubbo.application.qosAcceptForeignIp=false
+```
diff --git a/img/blog/qos-architecture.png b/img/blog/qos-architecture.png
new file mode 100644
index 0000000..14989ee
Binary files /dev/null and b/img/blog/qos-architecture.png differ
diff --git a/md_json/blog.json b/md_json/blog.json
index fec7f25..46823e9 100644
--- a/md_json/blog.json
+++ b/md_json/blog.json
@@ -25,6 +25,10 @@
"__html": "<h1>从跨语言调用到dubbo2.js</h1>\n<blockquote>\n<p><a href=\"https://github.com/dubbo/dubbo2.js\">dubbo2.js</a> 是 <a href=\"https://www.qianmi.com/\">千米网</a> 贡献给 dubbo 社区的一款 nodejs dubbo 客户端,它提供了 nodejs 对原生 dubbo 协议的支持,使得 nodejs 和 java 这两种异构语言的 rpc 调用变得便捷,高效。</p>\n</blockquote>\n<h2>微服务跨语言调用</h2>\n<p>微服务架构已成为目前互联网架构的趋势,关于微服务的讨论,几乎占据了各种技术大会的绝大多数版面。国内使用最多的服务治理框架非阿里开源的 dubbo 莫属,千米网也选择了 dubbo 作为微服务治理框架。另一方面,和大多数互联网公司一样,千米的开发语言是多样的,大多数后端业务由 java 支撑,而每个业务线有各自开发语言的选择权,便出现了 nodejs,pyth [...]
},
{
+ "filename": "introduction-to-dubbo-qos.md",
+ "__html": "<h1>通过QoS对服务进行动态控制</h1>\n<p>QoS,全称为<code>Quality of Service</code>, 是常见于网络设备中的一个术语 ,例如在路由器中,可以通过Qos动态的调整和控制某些端口的权重,从优先的保障运行在这些端口上的服务质量。</p>\n<p>在Dubbo中,QoS这个概念被用于动态的对服务进行查询和控制。例如对获取当前提供和消费的所有服务,以及对服务进行动态的上下线,即从注册中心上进行注册和反注册操作。</p>\n<h3>QoS工作机制</h3>\n<p>从Dubbo 2.5.8开始,默认引入了Qos功能,默认处于启动状态。所有的QoS功能被抽象成一个个的命令,通过执行这些命令,Qos会返回响应的结果。</p>\n<blockquote>\n<p>Qos功能基于Netty4实现,在Dubbo 2.6.x之前的版本中,默认依赖的是Netty3,因此需要显示的添加Netty4的依赖,才能确保Netty4正常工作。如果使用http://start.dubbo.io自�
��生成的Dubbo应用,则无需添 [...]
+ },
+ {
"filename": "introduction-to-dubbo-spi-2.md",
"__html": "<h1>Dubbo可扩展机制源码解析</h1>\n<hr>\n<p>在<a href=\"#/blog/introduction-to-dubbo-spi.md\">Dubbo可扩展机制实战</a>中,我们了解了Dubbo扩展机制的一些概念,初探了Dubbo中LoadBalance的实现,并自己实现了一个LoadBalance。是不是觉得Dubbo的扩展机制很不错呀,接下来,我们就深入Dubbo的源码,一睹庐山真面目。</p>\n<h1>ExtensionLoader</h1>\n<p>ExtentionLoader是最核心的类,负责扩展点的加载和生命周期管理。我们就以这个类开始吧。\nExtension的方法比较多,比较常用的方法有:</p>\n<ul>\n<li><code>public static <T> ExtensionLoader<T> getExtensionLoader(Class<T> type)</code></li>\n<li><code>public T getExtensi [...]
},
diff --git a/site_config/blog.js b/site_config/blog.js
index e8fc43b..83e83fa 100644
--- a/site_config/blog.js
+++ b/site_config/blog.js
@@ -52,6 +52,13 @@ export default {
postsTitle: '所有文章',
list: [
{
+ title: '通过QoS对服务进行动态控制',
+ author: 'Huxing Zhang',
+ dateStr: 'August 2nd, 2018',
+ desc: '介绍了如何使用Dubbo的QoS功能对服务进行动态配置,以及相关的参数及配置方式。',
+ link: '/blog/introduction-to-dubbo-qos.md',
+ },
+ {
title: '在 Dubbo 中使用注解',
author: '@beiwei30',
dateStr: 'August 1st, 2018',