当前位置:网站首页>RPC 远程过程调用
RPC 远程过程调用
2022-07-27 06:50:00 【ziye 子叶】
RPC简介
RPC,英文全称: Remote Procedure Call. 中文名: 远程过程调用,是一个计算机通讯协议.借助RPC可以像调用本地服务一样地调用远程服务.比如两台服务器订单服务器和商品服务器,订单服务器需要调用商品详情的方法,由于两个应用不在一个内存空间,不能直接调用,所以需要通过网络来表达调用的语义和传达调用的数据.需要注意的是RPC不是具体的技术,而是指整个网络远程调用的过程

RPC四个核心组件
Client(客户端),服务的调用方.
Client Stub(客户端存根),存放服务端的地址消息,再将客户端的请求参数打包成网络消息,然后通过网络远程发送给服务方.
Server(服务端),服务的真正提供者.
Server Stub(服务端存根),接收客户端发送过来的消息,将消息捷豹,并调用本地的方法.
- 客户端(client)以本地调用方式(即以接口的方式)调用服务;
- 客户端存根(client stub)接收到调用后,负责将方法、参数等组装成能够进行网络传输的消息体
(将消息体对象序列化为二进制); - 客户端通过socket将消息发送到服务端;
- 服务端存根( server stub)收到消息后进行解码(将消息对象反序列化);
- 服务端存根( server stub)根据解码结果调用本地的服务;
- 服务处理(业务处理)
- 本地服务执行并将结果返回给服务端存根( server stub);
- 服务端存根( server stub)将返回结果打包成消息(将结果消息对象序列化);
- 服务端(server)通过socket将消息发送到客户端;
- 客户端存根(client stub)接收到结果消息,并进行解码(将结果消息发序列化);
- 客户端(client)得到最终结果。
RPC的目标是将 2,3,4,5,7,8,9,10 这些步骤封装起来,只剩下 1,6,11
Duboo,Feign,gRPC等均属于RPC框架
其他章节 -> 跳转
end
边栏推荐
- Okaleido生态核心权益OKA,尽在聚变Mining模式
- Essay: college entrance examination
- Routing between VLANs (explanation + verification)
- Codeforces Round #810 (Div.2) A-C
- The solution of using sqlplus to display Chinese as garbled code
- 在kettle使用循环来处理表中的数据
- flink1.14 sql基础语法(一) flink sql表查询详解
- Panabit SNMP configuration
- Systematic explanation of unit testing: mockito
- Flink principle (I) TTL management and fault tolerance mechanism of state
猜你喜欢

js中的数组方法与循环

Gossip: talk with your daughter about why you should learn culture lessons well

Flutter实战-请求封装(一)

Port forwarding summary

Li Mu hands-on learning, in-depth learning, V2 transformer and code implementation

在kettle中快速更新一个字段中的信息

The DrawImage method calls the solution of not displaying pictures for the first time

在kettle使用循环来处理表中的数据

Cadence(十一)丝印调整和后续事项

(2022杭电多校三)1011.Taxi(曼哈顿最值+二分)
随机推荐
centos7中关闭oracle服务自动启动的功能
Prior Attention Enhanced Convolutional Neural Network Based Automatic Segmentation of Organs at Risk
用shell来计算文本中的数字之和
JS make a traffic light
Cadence(十一)丝印调整和后续事项
A small cotton padded jacket with air leakage
Actual combat of flutter - Request encapsulation (I)
Essay: college entrance examination
The DrawImage method calls the solution of not displaying pictures for the first time
Turn off the auto start function of Oracle service in centos7
MySQL backup strategy
【WSL2】配置连接 USB 设备并使用主机的 USB 摄像头
Examples of Oracle triggers
flink去重(一)flink、flink-sql中常见的去重方案总结
海康h9摄像头用xshell无法连接(没有启用ssh)
Zabbix: map collected values to readable statements
Multithreading [preliminary - Part 1]
C语言 pthread_cleanup_push()和pthread_cleanup_pop()函数(用于临界资源程序段中发生终止动作后的资源清理任务,以免造成死锁,临界区资源一般上锁)
js正则表达式实现每三位数字加一个逗号
flink原理(一) 状态的TTL管理、容错机制