You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
***TTL Auto-Cleanup**: Terminal-state tasks are automatically removed after a configurable TTL (default: 5 minutes). A daemon thread runs cleanup every 60 seconds.
123
-
***Race Condition Prevention**: `pendingTasks.put(taskId, future)` is called **before**`transport.publish()` to ensure the future is registered before any synchronous delivery could trigger `handleResponse()`.
124
-
125
-
#### REST API
126
-
127
-
| Method | Path | Description |
128
-
| :--- | :--- | :--- |
129
-
|`POST`|`/a2a/tasks?mode=sync`| Submit task synchronously (wait for result) |
|`GET`|`/a2a/tasks/{taskId}`| Get task status and result |
132
-
|`DELETE`|`/a2a/tasks/{taskId}`| Cancel a task |
133
-
|`GET`|`/a2a/tasks/{taskId}/wait`| Long-poll wait for task result |
134
-
|`GET`|`/a2a/tasks/{taskId}/stream`|**SSE** stream of task status updates |
135
-
|`GET`|`/a2a/agents`| List all registered agents |
136
-
|`POST`|`/a2a/heartbeat`| Agent heartbeat |
137
-
|`GET`|`/a2a/cards/list`| List all AgentCards |
138
-
|`POST`|`/a2a/cards/card/{org}/{unit}/{agent}`| Register an AgentCard |
139
-
140
-
### 3.4 Asynchronous RPC Mapping ( The "Async Bridge" )
76
+
### 3.3 Asynchronous RPC Mapping ( The "Async Bridge" )
141
77
142
78
To support MCP on an Event Bus, synchronous RPC concepts are mapped to asynchronous events:
143
79
@@ -177,18 +113,6 @@ To support MCP on an Event Bus, synchronous RPC concepts are mapped to asynchron
177
113
***Operation**: `message/sendStream`
178
114
***Mechanism**: Maps to `.stream` event type and preserves sequence order via `seq` extension attribute.
179
115
180
-
#### D. SSE Task Streaming (Gateway)
181
-
***Endpoint**: `GET /a2a/tasks/{taskId}/stream`
182
-
***Mechanism**: Server-Sent Events (`text/event-stream`) pushes real-time task state transitions.
183
-
***Flow**: Initial state → WORKING updates → terminal state → connection close.
184
-
***Implementation**: Handler writes `DefaultHttpContent` chunks directly to the Netty channel, returning `null` to skip the standard `FullHttpResponse` path.
185
-
186
-
#### E. Task TTL Auto-Cleanup (Gateway)
187
-
* Terminal-state tasks are automatically removed by a daemon scheduler after a configurable TTL (default: 5 minutes, cleanup interval: 60 seconds), preventing memory leaks.
188
-
189
-
#### F. AgentCard Discovery & Heartbeat (Gateway)
190
-
* AgentCards expire after 60 seconds without heartbeat. `POST /a2a/heartbeat` refreshes the last-seen timestamp.
191
-
192
116
## 5. Usage Examples
193
117
194
118
### 5.1 Sending a Tool Call (Request)
@@ -225,92 +149,7 @@ To support MCP on an Event Bus, synchronous RPC concepts are mapped to asynchron
225
149
*`subject`: `market.crypto.btc`
226
150
*`targetagent`: (Empty)
227
151
228
-
### 5.3 Gateway REST API (HTTP)
229
-
230
-
The A2A Gateway provides a REST API for external clients and non-Java agents.
231
-
232
-
#### 5.3.1 Submit Task (Sync)
233
-
234
-
```bash
235
-
curl -X POST 'http://localhost:10105/a2a/tasks?mode=sync' \
0 commit comments