当前位置:网站首页>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
边栏推荐
- Using docker in MAC to build Oracle database server
- Haikang H9 camera cannot be connected with xshell (SSH is not enabled)
- JS make a traffic light
- Gossip: talk with your daughter about why you should learn culture lessons well
- Want to sink into redis hash and write in the attributes and values of the object. Do the bosses have a demo?
- C common function integration-2
- SQL statement batch update time minus 1 day
- Closed hash and open hash resolve hash conflicts
- Perl: split the external command to be executed into multiple lines
- Using soci to connect Oracle with PostgreSQL and SQLite on rhel8
猜你喜欢

Top ten interview questions for software testing (with answers and analysis)

C common function integration-3

C winfrom common function integration-2

单臂路由(讲解+实验)

连接MySQL时报错:Public Key Retrieval is not allowed 【解决方法】

Perl: 将要执行的外部命令拆分为多行

在Perl程序中暴露Prometheus指标

ARP广播实践案例

Gossip: Recently, many friends talk about going abroad

杂谈:最近好多朋友谈出国……
随机推荐
Examples of Oracle triggers
(2022 Hangdian multi school III) 1011.taxi (Manhattan maximum + 2 points)
Regular expression foundation sorting
Multi condition query of when
Record a pit dug by yourself~
Systematic explanation of unit testing: mockito
Chapter 6 Shell Logic and Arithmetic
Use Amazon dynamodb and Amazon S3 combined with gzip compression to maximize the storage of player data
js正则表达式实现每三位数字加一个逗号
View the dmesg log before server restart
STM32_ Find the cause of entering hardfault_ Handler's function
Flutter实战-请求封装(一)
Closed hash and open hash resolve hash conflicts
Want to sink into redis hash and write in the attributes and values of the object. Do the bosses have a demo?
Essay: college entrance examination
UI gesture actions of uiautomator common classes
Mysql: increase the maximum number of connections
用shell来计算文本中的数字之和
Codeforces Round #810 (Div.2) A-C
利用 Amazon DynamoDB 和 Amazon S3 结合 gzip 压缩,最大化存储玩家数据