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.
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.
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.
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.
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.
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.
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-a2a
Apache RocketMQ + A2A + Google ADK(Agent Development Kit) sample
Please see the rocketmq-multiagent-base-adk.
Apache RocketMQ + A2A + AgentScope sample
Please see the rocketmq-multiagent-base-agentscope.
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