Design and Implementation of the Xinge Messaging Platform for Decoupled Business Notifications
The article describes the background, pain points, and detailed design of the Xinge messaging platform, including decoupling of messages, lifecycle management, rate‑limiting strategies, template usage, and future enhancements to provide a unified, reliable backend service for business notifications.
1 Background
As business processes move online, instant‑messaging services such as Enterprise WeChat and Feishu become essential communication channels. The growing number of notification requirements led to scattered message‑sending code across services, causing strong coupling, code duplication, and occasional message loss.
1.1 Strong Coupling of Message and Business Code
Message‑sending logic is tightly intertwined with business workflows, so any failure in the messaging system can directly block the business process.
1.2 Code Duplication Across Services
Multiple services implement their own message‑sending utilities, increasing redundancy and making updates error‑prone.
1.3 Occasional Message Loss
Direct HTTPS calls to various platforms from dispersed utilities result in messages sometimes being lost without reliable tracing.
2 Current Situation and Pain Points
Various services need to send messages via many channels (Enterprise WeChat, Feishu, SMS, email, etc.). To avoid duplicated effort, the "Xinge" platform was built as a centralized messaging service that manages the full message lifecycle, ensures stability, and provides business analytics.
3 Design and Implementation
The Xinge service performs several steps to make its API easy to use:
Message service authentication
Template loading
Pre‑validation
Multi‑channel rate‑limit compatibility
Retry handling
Lifecycle monitoring
3.1 Three Elements of Message Decoupling
Messages are split into three configurable elements: Scenario (business context), Robot (the sending application), and Template (the message format).
3.2 Lifecycle
All messages share a unified lifecycle: Initialized → Sending → Sent Successfully → Retrying → Failed. The unique message ID allows status inspection.
3.3 Rate Limiting
3.31 Adapting to External Platform Limits
When sending frequency exceeds platform quotas (e.g., Feishu 50 req/s per app, 1000 msg/min per app, 100 msg/min per group bot, 5 msg/s per user), messages are dropped, contributing to loss.
Enterprise WeChat limits each robot to 20 messages/min.
To handle these constraints, Xinge implements two rate‑limiting algorithms—counter and token‑bucket—wrapped in custom annotations, allowing flexible switching per platform.
Impact of Queue Buildup
For example, Enterprise WeChat allows 30 messages/min per user. If 210 messages are generated for a single user, it takes at least 7 minutes to deliver, causing other scenarios to wait. Xinge mitigates this by partitioning queues per scenario and round‑robin consumption, reducing latency.
3.32 Interface Rate Limiting
When the service is accessed via SCF, SCF’s configuration can enforce API‑level rate limits, simplifying throttling and ensuring stability under high concurrency.
3.4 Message Templates
Xinge provides ready‑made templates (e.g., a Feishu message template) so services only need to fill required parameters and call the API, greatly improving development speed and reducing integration complexity.
4 Summary
The Xinge platform has become a core component of the new‑media business system, offering unified message management and efficient delivery. Future work includes transactional messages, priority sorting, and night‑time delivery suppression to further strengthen the service.
Zhuanzhuan Tech
A platform for Zhuanzhuan R&D and industry peers to learn and exchange technology, regularly sharing frontline experience and cutting‑edge topics. We welcome practical discussions and sharing; contact waterystone with any questions.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.