This project aims to help developers quickly integrate Apache RocketMQ with A2A.
The choice of communication middleware is very important when building a distributed Agent architecture with high availability and scalability.
- Enable Asynchronous Communication and Logical Decoupling
With Apache RocketMQ as the underlying transport, Agent-to-Agent interactions shift from synchronous RPC calls to asynchronous messaging, decoupling producer and consumer logic. Senders can proceed immediately without blocking on responses, significantly improving system throughput and responsiveness.
- Enhance Fault Tolerance and Resilience to Network Fluctuations
Apache RocketMQ ensures message persistence and supports configurable retry policies, preventing message loss during transient network outages. This mitigates cascading failures and guarantees eventual delivery, strengthening overall communication reliability.
- Improve System Stability and Availability
As a production-proven messaging infrastructure, Apache RocketMQ enhances the robustness and SLA compliance of the entire A2A Agent network, ensuring continuous operation under failure conditions.
- Smooth Traffic Spikes with Load Buffering
In high-concurrency scenarios, Apache RocketMQ acts as a buffer to absorb message bursts, smoothing peak loads and protecting downstream services from overload—enabling elastic scaling and balanced resource utilization.
- Standardize Integration to Simplify Development and Operations
The RocketMQTransport component provides a unified messaging abstraction, hiding transport complexity and allowing developers to focus on business logic.
The RocketMQA2AServerRoutes enables streamlined server-side routing and message dispatching, reducing integration effort and operational overhead.
- JDK 17 and above
- Maven 3.9 and above
Add a dependency using maven:
<!--add dependency in pom.xml-->
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-a2a</artifactId>
<version>${RELEASE.VERSION}</version>
</dependency>Create an A2A Client Using RocketMQTransport and RocketMQTransportConfig
// build client with RocketMQTransport and RocketMQTransportConfig
RocketMQTransportConfig rocketMQTransportConfig = new RocketMQTransportConfig();
rocketMQTransportConfig.setAccessKey(accessKey);
rocketMQTransportConfig.setSecretKey(secretKey);
rocketMQTransportConfig.setWorkAgentResponseGroupID(WorkAgentResponseGroupID);
rocketMQTransportConfig.setWorkAgentResponseTopic(WorkAgentResponseTopic);
rocketMQTransportConfig.setRocketMQNamespace(RocketMQNamespace);
Client client=Client.builder(finalAgentCard)
.addConsumers(consumers)
.streamingErrorHandler(streamingErrorHandler)
.withTransport(RocketMQTransport.class,rocketMQTransportConfig)
.build();Add RocketMQA2AServerRoutes to enable server-side request forwarding over the RocketMQ protocol, specifically for server implementations based on Quarkus
<!--add this in application.properties-->
quarkus.index-dependency.rocketmq-a2a.group-id=org.apache.rocketmq
quarkus.index-dependency.rocketmq-a2a.artifact-id=rocketmq-a2aApache RocketMQ + A2A + Google ADK(Agent Development Kit) sample
Please see the rocketmq-multiagent-base-adk.
Apache RocketMQ + A2A + AgentScope Sample Will Add soon ~
We are always very happy to have contributions, whether for trivial cleanups or big new features. Please see the RocketMQ main website to read the details.
Apache License, Version 2.0 Copyright (C) Apache Software Foundation