# custom-dubbo **Repository Path**: learn_every_day/custom-dubbo ## Basic Information - **Project Name**: custom-dubbo - **Description**: 基于netty实现的简易的RPC调用 - **Primary Language**: Unknown - **License**: AGPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-09-07 - **Last Updated**: 2022-09-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # custom-dubbo #### 介绍 基于netty实现的简易的RPC调用 #### 软件架构 软件架构说明 ##### 包结构 ![](img/架构图.png) ##### 启动过程 ![](img/启动过程.png) ##### 一次请求过程 ![](img/一次请求.png) #### 安装教程 在项目pom文件中引入依赖, 以及自己的服务提供方的api包 ``` org.example custom-dubbo 1.0-SNAPSHOT ``` #### 使用说明 * 服务提供方\ 在自己的服务提供方的主启动类中添加一下代码以启动本功能 例如 ```java public class Server { public static void main(String[] args) throws InterruptedException { // 启动服务监听 Start.init(); } } ``` * 服务消费方\ 在服务消费方中,不用启动初始化,在我们获取消费者时会触发ConsumerService类的初始化从而进行包扫描 例如: ```java @ConsumerService("helloClient") public class HelloClient { @Reference("helloService") private HelloService helloService; public static void main(String[] args) { HelloClient consumer = ConsumerRegister.getConsumer(HelloClient.class); System.err.println(consumer.sayHello("xc")); } public String sayHello(String name){ return helloService.sayHello(name); } } ``` * 配置文件\ 配置文件名为`config.properties`,放在项目的`resources`目录下 就目前的配置,`scan.package`配置是必须的 例如: ```properties host=127.0.0.1 port=8888 scan.package=com.cong.service ```