$ show wildfirechat/im-server
Wildfire Chat IM Server is a production-grade instant messaging backend built on a heavily customized Moquette MQTT broker. It provides MQTT-based client connectivity, HTTP REST APIs for admin/robot/channel management, and supports features like private/group/chatroom/channel messaging, file/media storage (local or Qiniu), push notifications, sensitive word filtering, conference/voice-video events, social moments, and multi-domain mesh federation. The architecture is a multi-module Maven project (broker, common, sdk, distribution) using Netty for networking, Hazelcast for distributed caching, and MySQL/H2 with Flyway migrations for persistence. The codebase demonstrates solid engineering with annotation-driven routing, protobuf message serialization, and a clean SDK for server-side integration. However, it suffers from a god-class in MemoryMessagesStore, duplicated configurations, vendored Netty MQTT codec, and some security concerns (hardcoded keys, weak XOR encryption). It is actively maintained with frequent schema migrations and feature additions, but the licensing is ambiguous (multiple license files) and documentation is primarily in Chinese.
The LLM identified 5 files worth highlighting for reuse:
A leaky bucket rate limiter implementation that can be extracted and reused in any Java application requiring per-key rate limiting. It uses a simple token bucket algorithm with configurable capacity and refill rate, and is thread-safe.
A Trie-based sensitive word filter that supports dynamic addition/removal of words and efficient text scanning. It is self-contained, has no external dependencies beyond standard Java, and can be reused in any content moderation system.
Abstract base class for message content types with encode/decode methods and a factory pattern for registration. This pattern allows defining custom message payloads and is reusable for any messaging system that needs extensible content types.
A generic API result wrapper that encapsulates an error code and optional result data. It provides a clean pattern for returning operation outcomes and can be reused in any Java SDK or service layer.
An asynchronous operation log recorder that uses a bounded blocking queue and a dedicated thread to persist audit events. It supports configurable topic/path whitelists and provides a reusable pattern for non-blocking audit logging in server applications.