{"id":49815456,"url":"https://github.com/vincentbin/bRPC","last_synced_at":"2026-05-29T21:00:49.918Z","repository":{"id":49828450,"uuid":"421877146","full_name":"vincentbin/bRPC","owner":"vincentbin","description":"✈A high-performance RPC based on Java \u0026 Netty.","archived":false,"fork":false,"pushed_at":"2022-05-28T15:30:57.000Z","size":93,"stargazers_count":238,"open_issues_count":0,"forks_count":69,"subscribers_count":32,"default_branch":"master","last_synced_at":"2023-11-07T16:28:41.536Z","etag":null,"topics":["java","nacos","netty","nio","rpc","rpc-framework","springboot","zookeeper"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vincentbin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-27T15:39:54.000Z","updated_at":"2023-10-08T12:17:54.000Z","dependencies_parsed_at":"2022-08-25T15:41:52.740Z","dependency_job_id":null,"html_url":"https://github.com/vincentbin/bRPC","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/vincentbin/bRPC","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincentbin%2FbRPC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincentbin%2FbRPC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincentbin%2FbRPC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincentbin%2FbRPC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vincentbin","download_url":"https://codeload.github.com/vincentbin/bRPC/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincentbin%2FbRPC/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33670211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","nacos","netty","nio","rpc","rpc-framework","springboot","zookeeper"],"created_at":"2026-05-13T06:00:43.974Z","updated_at":"2026-05-29T21:00:49.912Z","avatar_url":"https://github.com/vincentbin.png","language":"Java","funding_links":[],"categories":["开发框架"],"sub_categories":["RPC框架"],"readme":"# bRPC\n\u003ca href=\"https://github.com/vincentbin/bRPC/blob/master/LICENSE\"\u003e\u003cimg alt=\"GitHub license\" src=\"https://img.shields.io/github/license/vincentbin/bRPC\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/vincentbin/bRPC\"\u003e\u003cimg alt=\"GitHub star\" src=\"https://img.shields.io/github/stars/vincentbin/bRPC\"\u003e\u003c/a\u003e\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eREADME 中文版本\u003c/strong\u003e\u003c/summary\u003e\n\u003cdiv\u003e\n\n## 一个基于netty的RPC框架\n\n1. 基于netty NIO、IO多路复用。\n2. client与server端建立心跳包保活机制。发生未知断连时，重连保证可靠长连接。\n3. 使用kryo序列化，自定义传输包，及传输格式，避免TCP沾包问题。\n4. 支持zookeeper或nacos做服务注册中心。\n5. 可在注解中配置server端业务线程池核心线程数及最大线程数，客户端可通过注解自由选择接口对应负载均衡策略。\n6. 可轻松整合SpringBoot进行使用。\n\n## Getting Start\n\n### 启动\n#### API式启动\n1. com.polyu.rpc.test.api.server.ServerTest.java  服务端启动\n2. com.polyu.rpc.test.api.client.ClientTest.java  客户端启动 并rpc调用HelloService.hello()\n\n#### 与SpringBoot整合启动（由于未发布到远程仓库，所以需本地maven install。）\n\n1. 客户端\n- maven\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.polyu\u003c/groupId\u003e\n    \u003cartifactId\u003enetty-client\u003c/artifactId\u003e\n    \u003cversion\u003e1.0-SNAPSHOT\u003c/version\u003e\n\u003c/dependency\u003e\n```\n- springboot\n```java\n@Component\npublic class Test {\n\n    @BRpcConsumer(version = \"1.0\", loadBalanceStrategy = RpcLoadBalanceConsistentHash.class, timeOutLength = 1000L)\n    private static HelloService helloService;\n\n    public static void test() throws InterruptedException {\n        String yyb = helloService.hello(\"yyb\");\n        System.out.println(\"yyb = \" + yyb);\n    }\n}\n```\n- application.properties\n```properties\nbRPC.client.registry.type=zookeeper\nbRPC.client.registry.address=127.0.0.1:2181\nbRPC.client.registry.target.name=springbootApplication\nbRPC.client.timeout.checkInterval=500\n```\n2. 服务端\n- maven\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.polyu\u003c/groupId\u003e\n    \u003cartifactId\u003enetty-server\u003c/artifactId\u003e\n    \u003cversion\u003e1.0-SNAPSHOT\u003c/version\u003e\n\u003c/dependency\u003e\n```\n- springboot\n```java\n@BRpcProvider(value = HelloService.class, version = \"1.0\")\npublic class HelloServiceImpl implements HelloService {\n    \n    @Override\n    public String hello(String name) throws InterruptedException {\n        return name;\n    }\n}\n```\n- application.properties\n```properties\nbRPC.server.application.name=springbootApplication\nbRPC.server.address=127.0.0.1:12277\nbRPC.server.registry.type=zookeeper\nbRPC.server.registry.address=127.0.0.1:2181\n```\n### 注册中心部署\n#### Docker Zookeeper部署（例 同样支持nacos）\n\n1. 拉取zk镜像\u0026emsp;\u0026emsp;\u0026emsp;指令：docker pull zookeeper:3.4.14\n2. 查看镜像id\u0026emsp;\u0026emsp;\u0026emsp;指令：docker images\n3. 拉起容器\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;指令：docker run -d -p 2181:2181 --name b-zookeeper --restart always {imageId}\n4. 查看容器id\u0026emsp;\u0026emsp;\u0026emsp;指令：docker ps -a\n5. 进入容器\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;指令：docker exec -it {containerId} /bin/bash\n6. 起注册中心\u0026emsp;\u0026emsp;\u0026emsp;指令：./bin/zkCli.sh\n\n\u003c/div\u003e\n\u003c/details\u003e\n\n## A netty-based RPC framewor\n\n1. Based on netty NIO, IO multiplexing.\n2. The client and server establish a heartbeat packet keep-alive mechanism. When an unknown disconnection occurs, reconnection ensures a reliable long connection.\n3. Use kryo serialization, customize the transmission package, and transmission format to avoid TCP packet contamination problems.\n4. Support zookeeper or nacos as service registration center.\n5. The number of core threads and the maximum number of threads in the server-side business thread pool can be configured in the annotations, and the client can freely choose the load balancing strategy corresponding to the interface through the annotations.\n6. Can easily integrate SpringBoot for use.\n\n## Getting Start\n\n### Start\n#### API startup\n1. com.polyu.rpc.test.api.server.ServerTest.java Server start\n2. com.polyu.rpc.test.api.client.ClientTest.java Client starts and rpc calls HelloService.hello()\n\n#### Start integrated with SpringBoot (Because it is not published to a remote warehouse, it needs local maven install.)\n\n1. client\n- maven\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.polyu\u003c/groupId\u003e\n    \u003cartifactId\u003enetty-client\u003c/artifactId\u003e\n    \u003cversion\u003e1.0-SNAPSHOT\u003c/version\u003e\n\u003c/dependency\u003e\n```\n- springboot\n```java\n@Component\npublic class Test {\n\n    @BRpcConsumer(version = \"1.0\", loadBalanceStrategy = RpcLoadBalanceConsistentHash.class, timeOutLength = 1000L)\n    private static HelloService helloService;\n\n    public static void test() throws InterruptedException {\n        String yyb = helloService.hello(\"yyb\");\n        System.out.println(\"yyb = \" + yyb);\n    }\n}\n```\n- application.properties\n```properties\nbRPC.client.registry.type=zookeeper\nbRPC.client.registry.address=127.0.0.1:2181\nbRPC.client.registry.target.name=springbootApplication\nbRPC.client.timeout.checkInterval=500\n```\n2. server\n- maven\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.polyu\u003c/groupId\u003e\n    \u003cartifactId\u003enetty-server\u003c/artifactId\u003e\n    \u003cversion\u003e1.0-SNAPSHOT\u003c/version\u003e\n\u003c/dependency\u003e\n```\n- springboot\n```java\n@BRpcProvider(value = HelloService.class, version = \"1.0\")\npublic class HelloServiceImpl implements HelloService {\n    \n    @Override\n    public String hello(String name) throws InterruptedException {\n        return name;\n    }\n}\n```\n- application.properties\n```properties\nbRPC.server.application.name=springbootApplication\nbRPC.server.address=127.0.0.1:12277\nbRPC.server.registry.type=zookeeper\nbRPC.server.registry.address=127.0.0.1:2181\n```\n### Registry deployment\n#### Docker Zookeeper deployment (example also supports nacos)\n\n1. docker pull zookeeper:3.4.14\n2. docker images\n3. docker run -d -p 2181:2181 --name b-zookeeper --restart always {imageId}\n4. docker ps -a\n5. docker exec -it {containerId} /bin/bash\n6. ./bin/zkCli.sh\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvincentbin%2FbRPC","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvincentbin%2FbRPC","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvincentbin%2FbRPC/lists"}