A2A protocol integration for Embabel Agent Framework enabling agent-to-agent communication
Get A2A endpoints running in your Spring Boot application.
Required: Embabel Agent Framework with these dependencies:
embabel-agent-core - AgentPlatform, Goal, ProcessOptionsembabel-agent-api - Autonomy, AgenticEventListenerembabel-common - Common utilitiesMaven:
<dependency>
<groupId>com.embabel.agent</groupId>
<artifactId>embabel-agent-a2a</artifactId>
<version>0.3.3</version>
</dependency>Gradle (Kotlin DSL):
implementation("com.embabel.agent:embabel-agent-a2a:0.3.3")Spring Boot automatically configures A2A endpoints when the module is on the classpath.
Default Endpoints:
GET /a2a/.well-known/agent.json - AgentCard discoveryPOST /a2a - JSON-RPC requests (streaming and non-streaming)Access Beans:
@Autowired
lateinit var agentCardHandler: AgentCardHandler
@Autowired
lateinit var requestHandler: AutonomyA2ARequestHandlerGet AgentCard:
curl http://localhost:8080/a2a/.well-known/agent.jsonSend Message:
curl -X POST http://localhost:8080/a2a \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "test-1",
"method": "message/send",
"params": {
"message": {
"messageId": "m1",
"role": "user",
"parts": [{"text": "Hello"}]
}
}
}'Stream Message:
curl -X POST http://localhost:8080/a2a \
-H "Content-Type: application/json" \
-H "Accept: text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": "stream-1",
"method": "message/stream",
"params": {
"message": {
"messageId": "m2",
"role": "user",
"parts": [{"text": "Research topic"}]
}
}
}'tessl i tessl/maven-com-embabel-agent--embabel-agent-a2a@0.3.3