QRPC is a custom, lightweight RPC (Remote Procedure Call) framework built for high performance and extensibility. This project follows modern best practices in distributed systems, leveraging advanced features like SPI mechanism, factory patterns, and a variety of serialization, registration, and load-balancing strategies.
-
Global Configuration
- Dynamic global configuration management for enhanced flexibility.
-
Serialization
- Support for multiple serialization mechanisms (JSON, Protobuf, etc.).
- Extensible through SPI + Factory patterns.
-
Registration Center
- Pluggable registration center implementations (Etcd, ZooKeeper).
- Optimizations for heartbeats, service caching, and auto-expiry.
-
Custom Protocol
- TCP-based transport layer designed using Vert.x for high concurrency.
- Implements custom messaging structure inspired by Dubbo.
- Solutions for packet fragmentation and reassembly.
-
Load Balancing
- Support for a variety of load balancing algorithms including Consistent Hashing.
- Easily extensible with custom load balancers using SPI + Factory.
-
Retry and Fault Tolerance Mechanisms
- Multiple retry strategies with customizable backoff policies.
- Pluggable fault-tolerance strategies for robust error handling.
-
Pluggable Architecture
- SPI (Service Provider Interface) used across the framework to allow for customization and extension of components.
- Factory pattern for creating extensible, scalable services.
-
Quick Startup
- Designed with annotation-driven configurations for easy setup using Spring Boot Starter.
To get started with QRPC, clone this repository and include it in your project:
git clone https://github.com/CodeinMac/qrpc.gitAdd the following to your pom.xml or build.gradle:
<dependency>
<groupId>com.yourorganization</groupId>
<artifactId>qrpc</artifactId>
<version>1.0.0</version>
</dependency>implementation 'com.yourorganization:qrpc:1.0.0'Here’s how to initialize and configure QRPC in your project:
- Configuration: Define global configurations for the framework.
- Register Services: Use the Etcd or ZooKeeper registration center for service registration.
- Serialization: Select and configure the serialization mechanism (e.g., JSON, Protobuf).
- Start the Framework: Launch the RPC services with the QRPC quick-start class.
QRpcServer server = new QRpcServer();
server.registerService(MyService.class, new MyServiceImpl());
server.start();The QRPC framework is designed for easy extensibility. Using the SPI and Factory patterns, you can plug in your own implementations for various components such as:
- Serialization strategies
- Registration centers
- Load balancers
- Retry mechanisms
- Fault-tolerance strategies
We welcome contributions! Please fork the repository and submit a pull request to propose changes or add new features.
This project is licensed under the MIT License. See the LICENSE file for details.