Skip to content

RockyLOMO/rxlib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3,007 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

℞lib-java

English | 中文

English

rxlib is a core Java foundation library designed for high-performance and high-concurrency scenarios. Built on top of Netty's low-level network programming, it provides extreme performance optimization and deep encapsulation for core components such as concurrency processing, I/O storage, network proxies, and RPC communication.

Maven Java CI

<dependency>
    <groupId>com.github.rockylomo</groupId>
    <artifactId>rxlib</artifactId>
    <version>2.22.3</version>
</dependency>

Core Features

For all detailed technical documentation and usage references, please check the docs/reference/ directory.

1. Network Components (org.rx.net)

A zero-allocation, low-latency, high-performance protocol stack based on Netty:

  • Proxy & NAT Traversal (SOCKS / SS / RRP): Supports SOCKS5, Shadowsocks, and the custom RRP reverse relay protocol. Includes full TCP/UDP protocol forwarding, Double-Array Trie smart routing, and underlying UDP disguise/acceleration.
  • RPC (Remoting): A self-developed lightweight RPC framework supporting TCP/UDP hybrid transmission and zero-copy efficient serialization based on Fury.
  • HTTP Client & Server: A lightweight, non-blocking HTTP server, alongside a high-performance HTTP client with connection pooling and cache control (includes RestClient similar to Feign).
  • DNS Server & Client: Replaces the blocking InetAddress to provide asynchronous, anti-breakdown DNS resolution and a local anti-pollution proxy.
  • UDP Hole Punching: A direct P2P communication framework for UDP in NAT environments.
  • NTP Time Synchronization: A lightweight NTP client protocol implementation ensuring time consistency across distributed clusters.
  • Internal Service Governance (Nameserver): Lightweight service registration, health keep-alive, and discovery.
  • Base Transport Layer: Highly encapsulated scaffolding for TCP/UDP clients and servers.

2. Concurrency & Resource Pooling (org.rx.core)

  • Adaptive Object Pool (ObjectPool): A lock-free/low-lock object pool tailored for hot paths, supporting adaptive dynamic scaling (Adaptive Refill) based on borrowing frequency.
  • Dynamic Thread Pool (ThreadPool): A thread pool that adapts to the optimal number of threads, featuring efficient task scheduling based on a HashedWheelTimer and built-in support for full-link asynchronous traces.

3. Storage & I/O Layer (org.rx.io)

4. Common Base Components


中文

rxlib 是一套为高性能、高并发场景设计的核心 Java 基础类库。它以 Netty 底层网络编程为基石,并对并发处理、I/O 存储、网络代理、RPC 通信等核心组件进行了极端的性能优化与深度封装。

Maven Java CI

<dependency>
    <groupId>com.github.rockylomo</groupId>
    <artifactId>rxlib</artifactId>
    <version>2.22.3</version>
</dependency>

核心特性 (Features)

所有详细的技术文档与使用参考,请查阅 docs/reference/ 目录。

1. 网络组件 (org.rx.net)

基于 Netty 实现的零分配、低延迟的高性能协议栈:

2. 并发与资源池 (org.rx.core)

  • 自适应对象池 (ObjectPool):专为热点路径设计的无锁/低锁对象池,支持基于借用频率的自适应动态扩缩容 (Adaptive Refill)。
  • 动态线程池 (ThreadPool):自适应最佳线程数,基于时间轮 (HashedWheelTimer) 的高效任务调度,并内置支持全链路异步 Trace。

3. 存储与 I/O 层 (org.rx.io)

4. 通用基础组件