The EventMesh A2A (Agent-to-Agent) Protocol is a specialized, high-performance protocol plugin designed to enable asynchronous communication, collaboration, and task coordination between autonomous agents.
With the release of v2.0, A2A adopts the MCP (Model Context Protocol) architecture, transforming EventMesh into a robust Agent Collaboration Bus. It bridges the gap between synchronous LLM-based tool calls (JSON-RPC 2.0) and asynchronous Event-Driven Architectures (EDA), enabling scalable, distributed, and decoupled agent systems.
The architecture adheres to the principles outlined in the broader agent community (e.g., A2A Project, FIPA-ACL, and CloudEvents):
Traditional A2A implementations often rely on HTTP Webhooks (POST /inbox) for asynchronous callbacks. While functional, this Point-to-Point (P2P) model suffers from significant scaling issues:
EventMesh A2A solves this by introducing Native Pub/Sub capabilities:
graph LR Publisher[Publisher Agent] -->|1. Publish (Once)| Bus[EventMesh Bus] subgraph Fanout_Layer [EventMesh Fanout Layer] Queue[Topic Queue] end Bus --> Queue Queue -->|Push| Sub1[Subscriber 1] Queue -->|Push| Sub2[Subscriber 2] Queue -->|Push| Sub3[Subscriber 3] style Bus fill:#f9f,stroke:#333 style Fanout_Layer fill:#ccf,stroke:#333
graph TD Client[Client Agent / LLM] -- "JSON-RPC Request" --> EM[EventMesh Runtime] EM -- "CloudEvent (Request)" --> Server[Server Agent / Tool] Server -- "CloudEvent (Response)" --> EM EM -- "JSON-RPC Response" --> Client subgraph Runtime [EventMesh Runtime] Plugin[A2A Protocol Plugin] end style EM fill:#f9f,stroke:#333,stroke-width:4px style Plugin fill:#ccf,stroke:#333,stroke-width:2px
eventmesh-protocol-a2a)The core logic resides in the eventmesh-protocol-plugin module.
EnhancedA2AProtocolAdaptor: The central brain of the protocol.CloudEvents or HTTP adaptors when necessary.A2AProtocolConstants: Defines standard operations like task/get, message/sendStream.JsonRpc* Models: Strictly typed POJOs for JSON-RPC 2.0 compliance.To support MCP on an Event Bus, synchronous RPC concepts are mapped to asynchronous events:
| Concept | MCP / JSON-RPC | CloudEvent Mapping |
|---|---|---|
| Action | method (e.g., tools/call) | Type: org.apache.eventmesh.a2a.tools.call.reqExtension: a2amethod |
| Correlation | id (e.g., req-123) | Extension: collaborationid (on Response)ID: Preserved on Request |
| Direction | Implicit (Request vs Result) | Extension: mcptype (request or response) |
| P2P Routing | params._agentId | Extension: targetagent |
| Pub/Sub Topic | params._topic | Subject: The topic value (e.g. market.btc) |
| Streaming Seq | params._seq | Extension: seq |
ProtocolTransportObject (byte array/string).jsonrpc: "2.0".method.message/sendStream, sets type suffix to .stream and extracts _seq._topic present, sets subject (Pub/Sub)._agentId present, sets targetagent (P2P).result/error. Sets collaborationid = id.List<CloudEvent>._agentId or _topic from JSON body to CloudEvent attributes.message/sendStream.stream event type and preserves sequence order via seq extension attribute.Raw Payload:
{ "jsonrpc": "2.0", "method": "tools/call", "params": { "name": "weather_service", "arguments": { "city": "New York" } }, "id": "msg-101" }
Raw Payload:
{ "jsonrpc": "2.0", "method": "market/update", "params": { "symbol": "BTC", "price": 50000, "_topic": "market.crypto.btc" } }
Generated CloudEvent:
subject: market.crypto.btctargetagent: (Empty)methods/list.