Search before asking
Enhancement Request
Motivation
Apache EventMesh is evolving toward an Agent messaging bus. The A2A (Agent-to-Agent) protocol needs a runtime gateway that enables agents to discover each other, send tasks, and receive streaming responses — all through standard HTTP/SSE without requiring every agent to implement the EventMesh messaging protocol directly.
Current State
EventMesh already has basic A2A protocol plugin support (eventmesh-protocol-a2a) with AgentCard discovery and EnhancedA2AProtocolAdaptor. However, there is no:
- REST API gateway for external HTTP clients
- SSE (Server-Sent Events) streaming for real-time task status
- Task lifecycle management (create -> running -> completed/failed/cancelled)
- Typed Java SDK for agent developers
- Health check / task list / pagination endpoints
Describe the solution you'd like
Proposal
A2A Gateway Runtime (eventmesh-runtime)
| Component |
Description |
A2AGatewayServer |
Standalone HTTP server entry point |
A2AGatewayService |
Core gateway logic: task timeout, agent validation, cancel notification, concurrent-safe subscribers |
A2AGatewayHttpHandler |
Netty-based REST handler: CORS, SSE streaming, health check, pagination, precise error codes |
TaskRegistry |
In-memory task lifecycle with TTL cleanup, CopyOnWriteArrayList for concurrency |
InMemoryA2AMessageTransport |
Default transport implementation |
A2A Protocol Plugin (eventmesh-protocol-a2a)
| Component |
Description |
A2AClient |
Typed Java SDK: sync/async task send, SSE streaming (streamTaskStatus), agent discovery, heartbeat |
A2AMessageTransport |
Transport abstraction interface |
A2ATopicFactory |
A2A topic convention standardization |
REST API Endpoints
| Method |
Path |
Description |
| POST |
/a2a/tasks?mode=sync|async |
Submit task |
| GET |
/a2a/tasks/{taskId} |
Query task status |
| GET |
/a2a/tasks/{taskId}/stream |
SSE streaming status |
| GET |
/a2a/tasks |
List tasks (paginated) |
| POST |
/a2a/tasks/{taskId}/cancel |
Cancel task |
| GET |
/a2a/agents |
List registered agents |
| GET |
/a2a/agents/{agentName}/card |
Get AgentCard |
| GET |
/a2a/health |
Health check |
Key Engineering Decisions
- Task timeout: auto-fail non-terminal tasks after configurable threshold
- SSE: heartbeat mechanism +
socketTimeout(0) for long-lived connections
- Concurrency:
CopyOnWriteArrayList + ConcurrentHashMap throughout
- CORS:
Access-Control-Allow-Origin on all A2A endpoints
- Agent validation: reject tasks for unregistered agents
Tests (all passing)
A2AGatewayServiceTest: 15+ tests (timeout, agent validation, cancel, SSE, pagination)
TaskRegistryTest: TTL, concurrent child creation, lifecycle transitions
A2AClientServerIntegrationTest: full client-server integration (SSE, CORS, health, heartbeat)
A2AGatewayEndToEndTest: end-to-end pipeline verification
A2ATopicFactoryTest, InMemoryA2AMessageTransportTest
Documentation
7 docs updated: eventmesh-a2a-design.md, ARCHITECTURE.md, IMPLEMENTATION_SUMMARY.md (EN/CN), TEST_RESULTS.md, README.md (EN/CN)
This issue tracks the A2A Gateway feature PR to upstream apache/eventmesh.
Are you willing to submit PR?
Code of Conduct
Search before asking
Enhancement Request
Motivation
Apache EventMesh is evolving toward an Agent messaging bus. The A2A (Agent-to-Agent) protocol needs a runtime gateway that enables agents to discover each other, send tasks, and receive streaming responses — all through standard HTTP/SSE without requiring every agent to implement the EventMesh messaging protocol directly.
Current State
EventMesh already has basic A2A protocol plugin support (
eventmesh-protocol-a2a) withAgentCarddiscovery andEnhancedA2AProtocolAdaptor. However, there is no:Describe the solution you'd like
Proposal
A2A Gateway Runtime (
eventmesh-runtime)A2AGatewayServerA2AGatewayServiceA2AGatewayHttpHandlerTaskRegistryCopyOnWriteArrayListfor concurrencyInMemoryA2AMessageTransportA2A Protocol Plugin (
eventmesh-protocol-a2a)A2AClientstreamTaskStatus), agent discovery, heartbeatA2AMessageTransportA2ATopicFactoryREST API Endpoints
/a2a/tasks?mode=sync|async/a2a/tasks/{taskId}/a2a/tasks/{taskId}/stream/a2a/tasks/a2a/tasks/{taskId}/cancel/a2a/agents/a2a/agents/{agentName}/card/a2a/healthKey Engineering Decisions
socketTimeout(0)for long-lived connectionsCopyOnWriteArrayList+ConcurrentHashMapthroughoutAccess-Control-Allow-Originon all A2A endpointsTests (all passing)
A2AGatewayServiceTest: 15+ tests (timeout, agent validation, cancel, SSE, pagination)TaskRegistryTest: TTL, concurrent child creation, lifecycle transitionsA2AClientServerIntegrationTest: full client-server integration (SSE, CORS, health, heartbeat)A2AGatewayEndToEndTest: end-to-end pipeline verificationA2ATopicFactoryTest,InMemoryA2AMessageTransportTestDocumentation
7 docs updated:
eventmesh-a2a-design.md,ARCHITECTURE.md,IMPLEMENTATION_SUMMARY.md(EN/CN),TEST_RESULTS.md,README.md(EN/CN)This issue tracks the A2A Gateway feature PR to upstream
apache/eventmesh.Are you willing to submit PR?
Code of Conduct