shenbinglife opened a new issue, #2703:
URL: https://github.com/apache/incubator-kyuubi/issues/2703

   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   
   
   ### Search before asking
   
   - [X] I have searched in the 
[issues](https://github.com/apache/incubator-kyuubi/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### Which parts of the documentation do you think need improvement?
   
   linkis-rpc是一个基于HTTP的消息中间件,将任意类型的请求通过protocolBuf序列化后,发送给指定的服务。
   ## Sender
   Sender是消息发送客户端抽象类。支持下面几种发送消息的方法:
   - ask:同步方法,该方法实时请求目标微服务,且要求目标微服务必须返回一个非空的返回值
   - send:同步方法,该方法实时请求目标微服务,并确保目标微服务成功接收了本次请求,但不要求目标微服务实时给出答复。
   - deliver:异步方法,该方法异步请求目标微服务,确保一定会请求目标微服务一次,但不保证目标微服务一定能成功接收到本次请求。
   
   静态方法:
   - 
getSender:从缓存中获取或者创建一个Sender。注意,如果Linkis启用了publicservice服务,并且目标服务是publicservice 
list中的一员,则设置Sender的目标ServiceInstance都为public服务。public服务作为了一个消息中间件处理和转发所有的消息。
   
   ## BaseRPCSender
   BaseRPCSender是对Sender的基本实现类。
   方法列表:
   - execute:获取RPC拦截器并遍历执行,拦截器执行完后,执行偏函数发送消息
   - 
ask实现:执行execute方法,在偏函数中执行具体的发送消息的功能,利用RPCProduct将任意对象转换成Message对象,利用RPCReceiveRemote的receiveAndReply方法将message对象通过HTTP协议发送出去,利用RPCConsumer将HTTP响应对象转换成具体的对象
   - send实现:基本和ask一致,区别在于调用RPCReceiveRemote的receive方法
   - 
deliver实现:将消息对象包装成RPCMessageEvent,放到rpcSenderListenerBus队列中。rpcSenderListenerBus定义了异步处理RPCMessageEvent的方法,调用Sender的send方法将消息发送出去
   
   ## SpringMVCRPCSender
   SpringMVCRPCSender实现了BaseRPCSender,区别在于下面几点
   - 获取RPCInterceptors时,会从SpringConetxt获取所有该类型的bean注入
   - 
创建RPCReceiveRemote的Fegine客户端时,会从SpringConetxt中获取相关的RPCLoadBalancer等信息,让RPCReceiveRemote支持负载均衡
   
   ## RPCReceiveRemote
   RPCReceiveRemote定义了HTTP接口。具体的RPC客户端则由Feign框架动态生成。Feign HTTP 
客户端的生成过程在BaseRPCSender和SpringMVCRPCSender都有描写。
   
   ### Affects Version(s)
   
   master
   
   ### Improving the documentation
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to