{"id":23613517,"url":"https://github.com/xk-dragonfly/xk-rpc","last_synced_at":"2025-08-26T03:15:04.748Z","repository":{"id":253495588,"uuid":"843686677","full_name":"xk-dragonfly/xk-RPC","owner":"xk-dragonfly","description":"This project provides a high-performance distributed RPC (Remote Procedure Call) system based on Spring Boot, Netty, and Zookeeper for efficient inter-service communication in microservices architectures.","archived":false,"fork":false,"pushed_at":"2024-12-27T14:45:52.000Z","size":136,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-27T15:30:05.012Z","etag":null,"topics":["netty","rpc","spring-boot","zookeeper"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xk-dragonfly.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":"2024-08-17T05:35:16.000Z","updated_at":"2024-12-27T14:45:55.000Z","dependencies_parsed_at":"2024-12-10T09:25:09.419Z","dependency_job_id":"59b57101-9ecb-4eae-acfd-1584b173d2ca","html_url":"https://github.com/xk-dragonfly/xk-RPC","commit_stats":null,"previous_names":["xk-dragonfly/xk-rpc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xk-dragonfly%2Fxk-RPC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xk-dragonfly%2Fxk-RPC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xk-dragonfly%2Fxk-RPC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xk-dragonfly%2Fxk-RPC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xk-dragonfly","download_url":"https://codeload.github.com/xk-dragonfly/xk-RPC/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231515090,"owners_count":18388409,"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":["netty","rpc","spring-boot","zookeeper"],"created_at":"2024-12-27T17:17:15.254Z","updated_at":"2024-12-27T17:17:16.118Z","avatar_url":"https://github.com/xk-dragonfly.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 Distributed xk-RPC System\n\nEnglish | [中文](README_cn.md)\n\n![Java](https://img.shields.io/badge/Java-17%2B-blue)\n![Spring Boot](https://img.shields.io/badge/Spring%20Boot-2.5.2-green)\n![Netty](https://img.shields.io/badge/Netty-4.1.65.Final-red)\n![Zookeeper](https://img.shields.io/badge/Zookeeper-3.7.1-yellow)\n![Nacos](https://img.shields.io/badge/Nacos-2.1.1-orange)\n![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen)\n\nA distributed RPC (Remote Procedure Call) system built with **Spring Boot**, **Netty**, and **Zookeeper**, designed to enable efficient communication between distributed services. This highly customizable system also supports **Nacos** as a service registry and the **HTTP protocol** as an alternative to Netty.\n\n---\n\n## 🌟 **Features**\n\n- 🔧 **Service Registration \u0026 Discovery**: Leverages Zookeeper for service management and supports Nacos as an alternative.\n- ⚡ **High-Performance RPC Communication**: Uses Netty for asynchronous communication, with optional HTTP support.\n- 📈 **Scalability**: Designed for large-scale distributed systems.\n- ☕ **Spring Boot Integration**: Simplifies configuration and accelerates development.\n\n---\n\n## 🛠️ **Getting Started**\n\n### 🧩 **Prerequisites**\n\n- ☑️ **Java 17** or higher\n- ☑️ **Maven**\n- ☑️ **Zookeeper** (or Nacos)\n- ☑️ **Netty** (or HTTP)\n\n#### ⚠️ **JDK Version Compatibility**\n\nIf using **JDK 9 or higher**, you **must** add the following JVM parameter before starting the `provider` module:\n\n```bash\n--add-opens java.base/java.lang=ALL-UNNAMED\n```  \n\nThis prevents the following error caused by Java's modular restrictions on reflection:\n\n```\njava.lang.reflect.InaccessibleObjectException: Unable to make field 'detailMessage' accessible\n```  \n\n---\n\n### 📥 **Installation**\n\n1. **Clone the repository**\n\n    ```bash\n    git clone https://github.com/xk-dragonfly/xk-RPC.git\n    ```\n\n2. **Set Up Zookeeper**\n\n   Install and start a Zookeeper instance or use an existing one. Update the `application.yml` or `application.properties` configuration file:\n\n    ```yaml\n    zookeeper:\n      connect-string: localhost:2181\n    ```  \n\n   If you prefer to use Nacos, replace the configuration:\n\n    ```yaml\n    nacos:\n      server-addr: localhost:8848\n    ```  \n\n3. **Build and Run**\n\n   Use Maven to build and start the `consumer` and `provider` modules:\n\n    ```bash\n    # Start the Provider module\n    cd provider\n    mvn clean install\n    mvn spring-boot:run\n    ```  \n\n    ```bash\n    # Start the Consumer module\n    cd ../consumer\n    mvn clean install\n    mvn spring-boot:run\n    ```  \n\n---\n\n## ⚙️ **Configuration**\n\n- **Switching to HTTP Protocol**: Modify communication classes to use Spring's `RestTemplate` or `WebClient`.\n- **Using Nacos for Service Registration**: Update the configuration file and replace Zookeeper-related dependencies and logic.\n\n---\n\n## 🎯 **Example Usage**\n\n- 📝 **Service Registration**: Services register with Zookeeper or Nacos using a unique name and endpoint.\n- 🔍 **Service Discovery**: Clients query the registry to locate and connect to services.\n- 📡 **Remote Procedure Call**: Clients invoke methods on remote services seamlessly using Netty or HTTP.\n\n---\n\n## 📂 **Project Structure**\n\n### 🔑 `rpc-core`\nCore functionalities of the RPC system, including:\n\n- 📦 **Message Design**: Defines the structure of RPC messages.\n- 🔒 **Encoding \u0026 Decoding**: Handles serialization and deserialization of messages.\n- 📜 **Service Management**: Manages service registration and discovery.\n- ⚙️ **Serialization**: Converts objects to transmission-ready formats.\n- 🎯 **Load Balancing**: Implements strategies to distribute workloads efficiently.\n\n---\n\n### 💻 `rpc-client`\nHandles client-side operations:\n\n- 🌉 **Client Proxy**: Dynamically generates proxies for remote method invocation.\n- 🔗 **Communication**: Manages message transport for requests and responses.\n\n---\n\n### 🖥️ `rpc-server`\nManages server-side operations:\n\n- 📨 **Message Processing**: Decodes incoming messages, executes methods, and returns results.\n\n---\n\n### 🛒 `consumer`\nSimulates the client and demonstrates how to initiate RPC calls, acting as an entry point for users.\n\n---\n\n### 🏗️ `provider`\nImplements server-side services, showcasing how to register and expose methods for RPC clients.\n\n---\n\n## 🤝 **Contributing**\n\nContributions are welcome! Please fork the repository and submit a pull request.\n\n---\n\n## 📜 **License**\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n\n---\n\n## 📬 **Contact**\n\nFor any questions or issues, open an issue on GitHub or email [xk0708666@gmail.com](mailto:xk0708666@gmail.com).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxk-dragonfly%2Fxk-rpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxk-dragonfly%2Fxk-rpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxk-dragonfly%2Fxk-rpc/lists"}