{"id":16423024,"url":"https://github.com/hiparker/lint-rpc-framework","last_synced_at":"2025-03-21T04:30:23.304Z","repository":{"id":170212413,"uuid":"646336717","full_name":"hiparker/lint-rpc-framework","owner":"hiparker","description":"一个轻量级Java RPC 框架, 底层采用Netty实现, 模拟Dubbo运行模式(闲来无事 练习一下)","archived":false,"fork":false,"pushed_at":"2023-05-30T06:57:02.000Z","size":50,"stargazers_count":68,"open_issues_count":0,"forks_count":17,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-17T20:43:35.788Z","etag":null,"topics":["factory","netty","nio","proxy","rpc-framework","spi"],"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/hiparker.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-28T04:03:53.000Z","updated_at":"2025-01-17T16:07:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"53184aba-665e-4019-91d8-9b38361a5a41","html_url":"https://github.com/hiparker/lint-rpc-framework","commit_stats":null,"previous_names":["hiparker/lint-rpc-framework"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiparker%2Flint-rpc-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiparker%2Flint-rpc-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiparker%2Flint-rpc-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiparker%2Flint-rpc-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hiparker","download_url":"https://codeload.github.com/hiparker/lint-rpc-framework/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244737974,"owners_count":20501744,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["factory","netty","nio","proxy","rpc-framework","spi"],"created_at":"2024-10-11T07:38:39.290Z","updated_at":"2025-03-21T04:30:23.281Z","avatar_url":"https://github.com/hiparker.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lint RPC Framework\n\u003cdiv align=\"center\"\u003e\n \u003cimg width=\"500\" src=\"https://www.bedebug.com/upload/2023/05/lint-rpc-s-1dba4e32e8e34df386fe92549d4c3a74.png\"/\u003e\n \u003cbr/\u003e \u003cbr/\u003e\n\n[![AUR](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://github.com/hiparker/opsli-boot/blob/master/LICENSE) [![netty](https://img.shields.io/badge/netty-4.1.90.Final-blue.svg)](https://github.com/hiparker/lint-rpc-framework) [![Stars](https://img.shields.io/github/stars/hiparker/lint-rpc-framework?style=flat-square\u0026label=Stars\u0026logo=github)](https://github.com/hiparker/lint-rpc-framework) [![Forks](https://img.shields.io/github/forks/hiparker/lint-rpc-framework?style=flat-square\u0026label=Forks\u0026logo=github)](https://github.com/hiparker/lint-rpc-framework)\n\u003c/div\u003e\n\n## 关于\n\u003e  LintRPC是一个轻量级Java RPC 框架, 底层采用Netty实现, 模拟Dubbo运行模式(闲来无事 练习一下)\n\n\u003e  本质上就是代替完成网络请求，让程序调用接口如调用本地的一个Interface一样简单\n\n## 地址\n- 作者博客: \u003ca href=\"https://www.bedebug.com\" target=\"_blank\"\u003ehttps://www.bedebug.com\u003c/a\u003e\n- 交流Q群: 724850675 (1群)\n\n## 相关技术栈\n| 名称             | 版本号 |\n| ---------------- |---|\n| Netty版本          | 4.1.90.Final |\n\n## 启动顺序\n1. lint-rpc-demo-provide2 (提供 drink结果 和 drinkListAll)\n2. lint-rpc-demo-provide1 (提供 eat结果 ，同时调用provide2，进行组合结果)\n3. lint-rpc-demo-consumer (分别调用 provide1、provide2)\n\n## 技术介绍\n1. lint-rpc-demo 为使用 lint-rpc框架做的demo，包含一个 consumer 两个provide\n   - 其中 consumer 开启20个线程 去定时请求 2个 provide，其中一个provide调用了另外一个provide\n2. lint-rpc-spi 利用SPI技术 固定服务列表扩展模式\n   - 先支持本地服务列表，后序可扩展成 nacos、zk等服务列表\n3. lint-rpc-support 为整个框架的核心包\n   - 其工作的原理便是，使用jdk自身的proxy去动态代理 rpc接口，\n   - 底层使用netty作为网络通信（懒得使用原生的nio网络模型了，太麻烦了 还需要处理一大堆东西）\n   - 在netty channel 的 handler中，定义了 protocol 自定义协议，用于规定网络传输格式和为后序jdk序列化做足准备\n   - 当provide收到请求后，通过序列化的结果，从本地spi库中查询本地服务，并通过反射进行invoke执行\n\n**相关技术点（读源码，你可以学习到）**\n```text\n1. 可扩展接口设计（类似与springboot的autoconfigure）\n   SPI\n\n2. 相关设计模式\n   动态代理、策略模式、工厂模式、单例模式\n   \n3. 池化思想\n\n4. Java反射\n\n5. 自定义消息协议 与 网络请求粘包拆包\n\n6. 多线程与高并发与线程锁\n```   \n\n\n## RPC需要什么\n### 想要实现一个基本的RPC框架，其实需要什么？\n1. 网络IO，BIO\\NIO\\AIO，Socket编程，HTTP通信，一个就行。\n2. 序列化，JDK序列化，JSON、Hessian、Kryo、ProtoBuffer、ProtoStuff、Fst知道一个就行。\n3. 反射，JDK或者Cglib的动态代理。\n   \n### 那一个优秀的RPC框架，还需要考虑什么问题?\n1. 一个服务可能有多个实例，你在调用时，要如何获取这些实例的地址？\n2. 服务注册中心多个实例，选哪个调用好？\n3. 负载均衡服务注册中心每次都查？\n4. 缓存相关客户端每次要等服务器返回结果？\n5. 异步调用服务是要升级的？\n6. 版本控制多个服务依赖，某个有问题？\n7. 熔断器某个服务出了问题怎么办？监控 ..\n\n## 支持\n\u003e 谢谢您愿意支持开源\n\u003cdiv align=\"center\"\u003e\n\u003cimg width=\"200\" src=\"https://gitee.com/hiparker/opsli-ui/raw/master/repository-images/vx.png\"/\u003e\n\u003cimg width=\"200\" src=\"https://gitee.com/hiparker/opsli-ui/raw/master/repository-images/zfb.png\"/\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiparker%2Flint-rpc-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhiparker%2Flint-rpc-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiparker%2Flint-rpc-framework/lists"}