# lagou-custom-rpc **Repository Path**: struggle_ly/lagou-custom-rpc ## Basic Information - **Project Name**: lagou-custom-rpc - **Description**: No description available - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-28 - **Last Updated**: 2021-11-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 1. # 基于课上自定义RPC代码中做如下功能实现 1. 客户端集成spring boot 1. 添加spring-boot-starter的依赖即可 2. 客户端提供Controller层,在浏览器发起用户查询功能 1. 客户端添加UserController,并提供getUserById接口 2. 通过浏览器访问http://localhost:8080/user/getUserById?id=1 3. 服务端提供2个或2个以上的服务 1. 勾选启动选项中的允许并行选项 ![image-20211128175612268](C:\Users\刘宇\Desktop\markDownImage\image-20211128175612268.png) 2. 启动两个服务,分别端口号是8081和8082 4. 客户端完成对服务端的负载轮询调用 1. 负载调用通过在服务端启动的时候将服务端启动的ip和端口号进行注册中心注册,然后在客户端调用的时候通过在注册中心进行轮询获取对应的ip和端口号进行调用。 1. 这里的注册中心是模拟的简单的一个注册中心,以本地文件中记录的方式来实现的,没有使用复杂的注册中心方式