BootNettyRpc:采用 Netty 实现的 RPC 框架
什么是 BootNettyRpc? BootNettyRpc 是一个采用Netty实现的Rpc框架,适用于Spring Boot项目,支持Spring Cloud。 目前支持的版本为Spring Boot 1.5.x,Spring Cloud版本为D和E版本。 怎么使用? 分为本地启动和结合Spring Cloud启动。具体见example 案例,现在以本地案例来说明,Spring Cloud案例省略。 BootNettyRpc 包括Server端和Client端。 Server端 在pom文件中加上依赖: <dependency> <groupId>io.github.forezp</groupId> <artifactId>boot-netty-rpc-core</artifactId> <version>1.0.5</version> </dependency> 在Spring Boot启动工程加上注解@EnableNettyRpc,需要开启包扫描,不填也可以,会全局扫描,有一点影响启动速度,比如例子中的ExampleRpcServerApplication: @SpringBootApplication @EnableNettyRpc(basePackages = "com.forezp") public class ExampleRpcServerApplication