Skip to content
/ krpc Public

实现一个基于netty单路复用网络模型的rpc框架,支持spring-boot启动,支持zookeeper,nacos注册中心

Notifications You must be signed in to change notification settings

kwsc98/krpc

Repository files navigation

krpc

实现一个基于netty单路复用网络模型的rpc框架,支持spring-boot启动,支持zookeeper,nacos注册中心。

以SpringBoot的方式启动

接口示例

public interface ExampeService {
   ResponseDTO doRun(RequestDTO requestDTO);
}

Customer

配置application.properties
krpc.registeredPath = nacos://114.116.3.221:8848

@KrpcResource(version = "1.0.1",timeout = 1000)
private ExampeService exampeService;

Provider

配置application.properties
krpc.registeredPath = nacos://114.116.3.221:8848
krpc.port = 8082

@KrpcService(version = "1.0.1")
public class ExampeServiceImpl implements ExampeService {
   
   @Override
   public ResponseDTO doRun(RequestDTO requestDTO) {
       ResponseDTO responseDTO = new ResponseDTO();
       responseDTO.setDate(new Date(requestDTO.getDate().getTime() + (long) requestDTO.getNum() * 60 * 60 * 1000));
       return responseDTO;
   }
}

About

实现一个基于netty单路复用网络模型的rpc框架,支持spring-boot启动,支持zookeeper,nacos注册中心

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages