RocketMQ for AI: LiteTopic-Based Agent Asynchronous Communication Architecture and Production Practice
As AI Agents move from single-turn Q&A to complex coding and tool collaboration, task execution stretches to minutes or even hours. They then face production-grade challenges such as network interruptions, resource contention, and state loss. Amid the ongoing evolution of RocketMQ for AI, Alibaba Cloud released several new LiteTopic features on September 22. The release came at the AI Real-Time Data Intelligence Forum of the Apsara Conference. Alibaba Cloud also showed the deployment of these features in Alibaba Cloud Model Studio and Qoder Cloud Agents. This article examines in depth how to use LiteTopic to build a highly reliable asynchronous communication architecture for Agents.

Trends and Challenges: When Agents Meet Long-Running Tasks
AI Agents now take on complex work such as coding and tool collaboration. One task may then go through multiple rounds of reasoning, external execution, and human confirmation. It can last tens of minutes or more. Whether work can resume from existing output after a network interruption, and whether progress survives an instance replacement, are becoming engineering problems. So is compute allocation when many requests arrive at once. Agents must solve all three before entering production.
An Agent no longer follows a simple Request-Response pattern. It now has to pass through a long lifecycle of submit, execute, wait, recover, and complete. This evolution brings three core challenges. First, blocking and waiting become the norm: complex tasks wait for external Tool callbacks, MCP service responses, Human-in-the-loop confirmation, and even GPU quota queues. Second, infrastructure is unstable: over execution cycles of several hours, network reconnections, Node crashes, and Pod evictions are unavoidable. Third, GPU resources are finite: limited compute must be scheduled fairly across users, with queuing and off-peak scheduling preventing resource contention and traffic bursts.
For long-running tasks, traditional in-memory retry mechanisms no longer suffice. We urgently need a new architecture that decouples the control plane from the data plane to achieve Durable Execution. It can persist task state and progress, keep them queryable and recoverable, and support real-time notifications.
Industry Consensus: Four Ways the Agent Harness Is Evolving
To reach these goals, the Control Plane of Agent execution is undergoing profound change. The industry consensus converges on four directions: externalized state, isolated execution, standardized protocols, and governable collaboration.
The first direction is architectural decoupling: full Brain-Hands-Session separation. Previously, components were often bound in one container; a process crash lost the entire task and made replacement hard. Now the control plane and data plane are split, so LLM inference (Brain), sandbox execution (Hands), and session context (Session) work as independent components. The sandbox becomes fully stateless and can be destroyed and rebuilt at any time.
At the same time, Durable Execution and asynchronous human collaboration (HITL) are natively supported. Task state is persisted as Checkpoints and the architecture turns event-driven, gracefully handling resumption scenarios such as network failures, asynchronous callbacks, and human approvals.
In addition, the MCP protocol unifies tool access, A2A connects Agents across frameworks, and Agent Skills load context dynamically on demand, easing Context Window bloat. Finally, at the execution layer, the monolith upgrades to a layered collaboration architecture. The main Agent (Supervisor) focuses on intent decomposition and result acceptance, while multiple sub-Agents (Workers) execute tasks in parallel in independent contexts and workspaces. This eliminates inefficient serial processing and keeps task logic intact.
New Release: Eight Key Capabilities of RocketMQ LiteTopic
To solve these problems, RocketMQ has introduced new LiteTopic features. They turn the black-box state of long-running tasks into a transparent, controllable stream of message events.
| Capability dimension | Key feature | Value description |
|---|---|---|
| Resource management | Lightweight resources | A single instance handles millions of lightweight topics with ease. Metadata adds no overhead and no load on the NameServer. The design targets massive Agent sessions. |
| Auto-creation | The first message write creates a LiteTopic automatically if it does not exist. No pre-provisioning is needed, and send latency is unaffected. | |
| TTL cleanup | When the time since a lightweight topic's last message write exceeds its expiration, the topic is deleted automatically. Whether to delete is decided based on actual business traffic, which simplifies LiteTopic metadata management. | |
| Consumption control | Consumer suspension (Suspend) | Message delivery can be suspended per LiteTopic. The suspend duration can be set flexibly, from tens of milliseconds to over ten hours. It can match a wide range of task-waiting scenarios precisely. |
| Exclusive subscription | At any moment, only one consumer instance can attach to a given LiteTopic. When a new connection is established, the old connection is dropped, which prevents duplicate tool execution from concurrent consumption at the source. | |
| Peek pull | Peek supports full read-only pulls and pulls from a specified Offset. It reads without consuming and does not advance the CommitLog progress. It is ideal for resuming from the last breakpoint and for SessionLog-based context reconstruction. | |
| Flexible routing | Full subscription | The * wildcard subscribes to all child LiteTopics under a Parent Topic, fully decoupling producers and consumers. Consumers do not need to know the names of auto-created or auto-deleted LiteTopics. |
| Differentiated subscription | Different consumers can subscribe to different LiteTopic sets, so each service node sees only its own session results, which eliminates broadcast consumption. |
RocketMQ also integrates fully into the existing Agent ecosystem through standard protocols and plugins. It delivers "minimal changes to business code, with asynchronous Agent communication through standard protocols and plugins".
In Production: Session State Continuity Through LiteTopic
In production, streaming interfaces between Agents and LLMs depend heavily on SSE/WebSocket long connections. Gateway rolling releases, Pod restarts, and network jitter drop these connections without warning. Generated Tokens cannot be delivered, GPU compute idles, and users must resend, which multiplies cost and wait time. Traditional Redis Stream solutions also fall short here. Their TTL counts from Key creation rather than message write, and wildcard subscriptions are not supported, so a Parent Topic cannot cover all child sessions at once. The appendfsync policy also struggles to balance reliability and performance.
For this pain point, RocketMQ LiteTopic offers a session continuity solution: "no loss on disconnect, no duplication on reconnect, and an experience that is transparent to users". Its core architecture has four layers. The multi-session access layer takes concurrent connections from the web, each Session carrying a unique ID. The stateless application cluster holds no local state, so any node can take over any Session and scale out. The LiteTopic session queue layer assigns each Session its own sub-queue (such as chat/Session1) under a unified Parent Topic CHAT_STREAM. The LLM task scheduling layer writes streaming Tokens into the corresponding LiteTopic by SessionID. When a connection drops, the consumer resubscribes with its last Offset and resumes from the breakpoint, without resending generated Tokens. The solution thus delivers continuous session state and optimized cost.

In Production: Alibaba Cloud Model Studio Uses LiteTopic for Fine-Grained Isolation and Rate Limiting
In a shared GPU resource pool, the platform must consider customer quotas, basic service opportunities, and burst traffic control at once. With only global rate limiting, excessive local traffic can spill over onto other users.
The Model Studio LiteTopic flow routes by the combination of userId and modelId, writing each user's requests for each model into the corresponding queue. Consumers use wildcard subscription on the Parent Topic to continuously discover and process dynamically created LiteTopics.
The rate limiting component tracks consumption rate per queue. When a target queue reaches its policy threshold, Suspend pauses its message delivery while other queues keep consuming. After conditions recover, the target queue processes backlog at a controlled pace.
This approach ties rate limiting to specific user-model combinations, giving quota guarantees and fair scheduling a finer enforcement mechanism. With bounded queuing, wait deadlines, and rejection policies, the platform can buffer short-term excess requests and reduces the pressure of concentrated retries on downstream systems. The traffic the platform can actually absorb still depends on model service capacity and scheduling policy.

In Production: Qoder Cloud Agents Uses LiteTopic for State Hosting and Execution Handoff of Long-Horizon Tasks
The engineering work behind Qoder Cloud Agents further shows the role of asynchronous communication in complex Agent runtimes. Its Cloud Agent Runtime targets Serverless cloud Agent hosting and execution, connecting task steps and execution results through LiteTopic.
For long-horizon tasks, the platform persists context and progress, providing the basis for state reconstruction after execution instance replacement. When many sessions run in parallel, lightweight business channels organize related messages, meeting in-channel ordering while letting independent tasks advance in parallel.
Capacity management also allows models and tools to be managed in separate pools. When resources are temporarily insufficient, the runtime pauses partially and resumes on demand when conditions are met and recovery events arrive. Whether concrete resources can be released during waiting is decided by the runtime based on task state and the execution environment.
With this division of responsibility, the platform hosts state management and execution handoff for long-horizon tasks. Business teams can keep refining coding workflows, focusing development on task completion quality and actual delivery.

Ecosystem Integration and Outlook
On ecosystem access, RocketMQ also integrates fully into the existing Agent ecosystem through standard protocols and plugins. It delivers "minimal changes to business code, with asynchronous Agent communication through standard protocols and plugins".
Specifically, RocketMQ achieves five key capabilities in ecosystem adaptation:
- MCP Agentic Messaging Primitives: RocketMQ supports long loops, streaming result output, and in-flight intervention with primitives such as Tasks, Subscriptions/Listen, and Progress Notifications. The roadmap will keep extending server-side event capabilities such as Webhooks and Channels, so that LLM Agent communication behavior has a defined basis to follow.
- A2A Transport layer: RocketMQ upgrades traditional point-to-point HTTP collaboration into an asynchronous, reliable, traceable communication channel. It natively supports cross-cluster collaboration, task delegation, and returning results, eliminating the timeouts and unreliability of synchronous HTTP calls in long-running tasks.
- RocketMQ Flink Connector: native LiteTopic consumption. When GPU quota is insufficient, Flink workers can actively suspend consumption. After resources recover, they resume from the last Offset, preventing backlogs from overwhelming downstream systems.
- OpenClaw RocketMQ Channel: task forwarding, result aggregation, and collaborative orchestration through LiteTopic. Developers no longer need to build their own message channels, greatly reducing the engineering cost of multi-Agent collaboration.
- Spring Cloud Gateway RocketMQ Rate Limiter: upgrades traditional hard rejection into three-state buffering of PASS, QUEUE, and REJECT. Excess requests are offloaded asynchronously to RocketMQ queues and released at a controlled rate. A 429 returns only when burst capacity is fully exhausted, significantly improving elasticity and user experience.
For detailed code, see the repository https://github.com/apache/rocketmq-ai
As Agents take on longer and more complex work, whether a task can continue after waits and failures directly affects user experience and resource efficiency. RocketMQ for AI work on LiteTopic offers concrete architectural references for session resumption, fine-grained scheduling, and cloud Agent execution. The RocketMQ for AI DingTalk discussion group is open for discussion with the product and technology teams on LiteTopic capability evolution, application scenarios, and deployment practices.
Read previous post:
The Data Foundation for Agent Self-Improvement: Alibaba Cloud SLS Session Store
-
-
Alibaba Cloud Native Community
840 posts | 61 followers
Follow
Comments
-
-
Alibaba Cloud Native Community
840 posts | 61 followers
Follow
Related Products
-
ApsaraMQ for RocketMQ
ApsaraMQ for RocketMQ is a distributed message queue service that supports reliable message-based asynchronous communication among microservices, distributed systems, and serverless applications.
Learn More -
ApsaraMQ for MQTT
A message service designed for IoT and mobile Internet (MI).
Learn More -
AgentCore
AgentCore unifies agent construction, governance, and execution capabilities so enterprises can deploy diverse agents with confidence.
Learn More -
Qoder
From Assisted to Autonomous — Adapting to Every Programming Need
Learn More
More Posts by Alibaba Cloud Native Community
- The Data Foundation for Agent Self-Improvement: Alibaba Cloud SLS Session Store
- QwenWork × AgentBridge: Connecting Enterprise Data and Bringing Intelligent Analysis Within Reach
- AgentTeams 1.2.8: A Brand-New Workbench and Website—Start Team Collaboration with One Click
- From Generation to Decision: An Empirical Evaluation of Decision Models for AgenticOps
- AgentScope Durable: Running Enterprise Agents Continuously and Reliably
- The Three Hidden Bills of an LLM Proxy: Security Incidents, Operational Investment, and Model Selection
- Managing Logs with Natural Language: A Practical Guide to Alibaba Cloud SLS Agent Skills
- Your AI Application Should Have a Traffic Entry Point: AI Gateway Serverless
- Best Practices for Skill Evaluation and Optimization Based on Alibaba Cloud AgentLoop