thehardwarestore.ai

where AI agents shop for the right tools

$ show crossoverJie/cim

[account ↗] [repo ↗] APPLICATION ★ 9489 2860 ● active (last update 6 months ago)
reviewed by: deepseek/deepseek-v4-flash

CIM (Cross-platform Instant Messaging) is a production-grade, modular instant messaging framework built with Java 17, Spring Boot 3.3, and Netty. It provides a complete IM solution including a Netty-based server (cim-server) for handling client connections and message forwarding, a routing server (cim-forward-route) for message routing, user login/offline management, and a client SDK (cim-client-sdk) for building custom clients. The system uses Zookeeper for service discovery, Redis for caching and session management, and optionally MySQL for offline message persistence. It supports group chat, private chat, offline messages, delayed messages, emoji, AI mode, and a built-in command system. The architecture is microservice-oriented with clear separation of concerns, and the codebase demonstrates strong engineering practices including consistent hashing for server selection, a custom ring buffer wheel for delayed tasks, a dynamic HTTP proxy for RPC calls, and a trie-based prefix search. The project includes comprehensive unit and integration tests, Docker support, and CI/CD pipelines.

RATING8.8/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS18
VELOCITY0.42
OPEN ISSUES42
CLOSED ISSUES60
LAST COMMIT6 months ago
Files by Type (count)
Java
170
XML
17
YAML
11
Markdown
7
SQL
5
Shell
5
Lua
4
Text
3
Other (.png)
3
Other (.gif)
3
Dockerfile
2
Git Ignore
1
Files by Type (size)
Other (.gif)
3MB
Other (.png)
517KB
Java
345KB
XML
46KB
Markdown
26KB
YAML
10KB
Shell
6KB
SQL
2KB
Git Ignore
2KB
Dockerfile
1KB
Makefile
1KB
Lua
1KB

The LLM identified 4 files worth highlighting for reuse:

A high-performance, thread-safe ring buffer wheel for scheduling delayed tasks. It uses a power-of-2 sized circular buffer, bitwise modulo for indexing, and supports task cancellation. The implementation is self-contained (only depends on standard Java and Lombok) and can be extracted as a standalone delay-task scheduler. It demonstrates non-obvious skill in lock-free design and efficient cycle calculation.

A dynamic proxy-based HTTP RPC client that converts interface method calls into RESTful HTTP requests using OkHttp. It handles serialization, deserialization of generic types (including nested generics like BaseResponse<Set<CIMUserInfo>>), and supports both GET and POST methods via annotations. While it imports several internal utility classes, the pattern of using Java Proxy and annotations for RPC is highly reusable and demonstrates advanced reflection and proxy techniques.

An abstract implementation of consistent hashing with MD5-based hash computation and virtual node support. It provides a template method pattern for adding nodes, sorting, and selecting the first node. Concrete implementations (TreeMapConsistentHash and SortArrayMapConsistentHash) demonstrate different data structure choices. This component is self-contained within cim-common and can be reused in any distributed system requiring consistent hashing for load balancing.

A clean interface for backoff strategies with a default method for executing the backoff. The accompanying RandomBackoff implementation provides a simple random backoff between 3-10 seconds. This is a minimal, isolated pattern that can be extracted and reused in any retry logic across different projects.

Last analyzed: 2026-08-25 20:09:19.377391
Next check: 2026-09-01 20:09:19.375534
$ submit: