<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>附录 on Apache Dubbo</title><link>https://deploy-preview-3203--dubbo.netlify.app/zh-cn/overview/reference/pixiu/other/user/appendix/</link><description>Recent content in 附录 on Apache Dubbo</description><generator>Hugo</generator><language>zh-cn</language><atom:link href="https://deploy-preview-3203--dubbo.netlify.app/zh-cn/overview/reference/pixiu/other/user/appendix/index.xml" rel="self" type="application/rss+xml"/><item><title>HTTP to Dubbo 默认转换协议</title><link>https://deploy-preview-3203--dubbo.netlify.app/zh-cn/overview/reference/pixiu/other/user/appendix/http-to-dubbo-default-stragety/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-3203--dubbo.netlify.app/zh-cn/overview/reference/pixiu/other/user/appendix/http-to-dubbo-default-stragety/</guid><description>&lt;h1 id="背景">背景&lt;/h1>
&lt;p>​	通过 Http 提供一个统一的服务提供者视图，用户不用在乎后端Dubbo服务的版本差异，协议差异，通过简单地在Http请求中传递rpc调用的参数，完成一次Rpc调用，通过实现http调用后端dubbo服务，进一步简化后端服务设计的复杂性。&lt;/p>
&lt;h1 id="目的">目的&lt;/h1>
&lt;p>​	统一Http调用后端dubbo服务的形式，方便网关产品实现 Http 调用转 dubbo 调用的实现，Dubbo能和网关更好的融合。&lt;/p>
&lt;h1 id="conception">Conception&lt;/h1>
&lt;h2 id="dubbo-rpc-调用的基本形式">Dubbo RPC 调用的基本形式&lt;/h2>
&lt;p>&lt;img alt="img" src="https://deploy-preview-3203--dubbo.netlify.app/imgs/pixiu/user/appendix/img1.png">&lt;/p>
&lt;p>希望通过提供Http调用Dubbo的方式简化 Consumer 的Rpc调用流程&lt;/p>
&lt;p>&lt;img alt="img" src="https://deploy-preview-3203--dubbo.netlify.app/imgs/pixiu/user/appendix/img2.png">&lt;/p>
&lt;p>网关会在整个服务调用的过程中承担更多的原本客户端的功能，比如负载均衡，服务治理，安全等能力，外部用户调用服务的时候将更多的关注与调用本身。&lt;/p>
&lt;h2 id="http-request-和-http-response-的格式">Http request 和 Http response 的格式&lt;/h2>
&lt;p>request的URL和Header中包含RPC调用的元信息，包含服务名，方法名，服务分组，服务版本，request 的 body 中包含请求的参数，参数是 &lt;strong>json list&lt;/strong> 的格式, 如果没有参数则为 &lt;em>&lt;strong>null&lt;/strong>&lt;/em>&lt;/p>
&lt;p>http response 中包含请求的处理状态，返回结果或者调用的错误类型以及错误具体信息，返回的body中只包含一个 &lt;em>&lt;strong>json object&lt;/strong>&lt;/em>，这个object中包含 &lt;em>&lt;strong>code&lt;/strong>&lt;/em>，&lt;em>&lt;strong>result&lt;/strong>&lt;/em>，&lt;em>&lt;strong>error&lt;/strong>&lt;/em>&lt;/p>
&lt;p>通过 code 表示返回的具体状态，result 和 error 在返回中只会返回其中一个，分别是调用的返回结果，调用返回的错误信息。&lt;/p>
&lt;h3 id="http-request">Http request&lt;/h3>
&lt;h4 id="http-请求的方法">Http 请求的方法&lt;/h4>
&lt;p>只能为 &lt;strong>POST&lt;/strong> 方法&lt;/p>
&lt;h4 id="http-请求的-url">Http 请求的 URL&lt;/h4>
&lt;p>格式：&lt;code>[http://host/ {service} / {method](http://host/service/method)}&lt;/code> or &lt;code>[https://host/ {service} / {method](https://host/service/method)}&lt;/code>&lt;/p>
&lt;ul>
&lt;li>service 是调用的服务名，对应于Dubbo message body中的 service Name&lt;/li>
&lt;li>method 是调用的方法名，对应于Dubbo message body中的 method Name&lt;/li>
&lt;/ul>
&lt;p>服务名和方法名都应该和后端服务的声明一致&lt;/p></description></item></channel></rss>