// the find
crossoverJie/cim
📲cim(cross IM) 适用于开发者的分布式即时通讯系统
CIM is a distributed IM system built on Netty + Spring Boot, aimed at developers who want to understand how an IM backend is put together or need a starting point for TCP push infrastructure. The architecture is three-tier: a stateless route server handles login and message dispatch, one or more IM servers hold persistent connections, and Zookeeper glues them together for service discovery.
The route/server split is the right call — route is stateless so you can put Nginx in front of it, while IM servers own the Netty channels. That separation means you can scale each layer independently without rebuilding the whole thing. Protobuf is used for the wire format, not JSON, which matters when you're pushing messages at volume. The client SDK (cim-client-sdk) is a real abstraction with reconnect backoff, state machine, and a MessageListener interface — something you can actually embed rather than copy-paste. There are also three pluggable load-balancing algorithms in cim-common (consistent hash with two backing data structures, round-robin, random), which makes this useful as a reference for how routing decisions work in practice.
No offline message delivery — explicitly in the TODO, and for an IM system this is a foundational missing piece. Any message sent while the recipient is disconnected is silently dropped. The cim-client is still a Spring Boot app that boots an embedded HTTP server on port 8084 just to receive messages; the TODO admits this should be replaced with picocli but it hasn't happened yet, so you're paying Spring Boot startup cost for a terminal chat client. Hard dependency on both Zookeeper and Redis from the start, with no single-node mode — running this to evaluate it requires spinning up two external services before you can send a single message. No message encryption anywhere in the stack, which rules out any real use case beyond internal tooling or demos.