Skip to content

Commit a2bff88

Browse files
kabirclaude
andcommitted
docs: Add executor configuration section to README
Document the @internal executor configuration options and their impact on streaming performance. Explains why the dedicated executor matters for preventing ForkJoinPool saturation under concurrent load. Includes: - Default configuration values (15 core, 30 max threads) - Property names for customization - Why it matters for streaming performance - Note about custom server integrations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 4e87726 commit a2bff88

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,38 @@ public class WeatherAgentExecutorProducer {
232232
}
233233
```
234234

235+
### 4. Configure Executor Settings (Optional)
236+
237+
The A2A Java SDK uses a dedicated executor for handling asynchronous operations like streaming subscriptions. By default, this executor is configured with 15 threads optimized for I/O-bound operations.
238+
239+
You can customize the executor settings in your `application.properties`:
240+
241+
```properties
242+
# Thread pool size for the @Internal executor (default: 15)
243+
a2a.internal.executor.core-pool-size=15
244+
245+
# Maximum thread pool size (default: 30)
246+
a2a.internal.executor.max-pool-size=30
247+
248+
# Thread keep-alive time in seconds (default: 60)
249+
a2a.internal.executor.keep-alive-time=60
250+
```
251+
252+
**Why this matters:**
253+
- **Streaming Performance**: The executor handles streaming subscriptions. Too few threads can cause timeouts under concurrent load.
254+
- **Resource Management**: The dedicated executor prevents streaming operations from competing with the ForkJoinPool used by other async tasks.
255+
- **Concurrency**: In production environments with high concurrent streaming requests, increase the pool sizes accordingly.
256+
257+
**Default Configuration:**
258+
```properties
259+
# These are the defaults - no need to set unless you want different values
260+
a2a.internal.executor.core-pool-size=15
261+
a2a.internal.executor.max-pool-size=30
262+
a2a.internal.executor.keep-alive-time=60
263+
```
264+
265+
**Note:** The reference server implementations automatically configure this executor. If you're creating a custom server integration, ensure you provide an `@Internal Executor` bean for optimal streaming performance.
266+
235267
## A2A Client
236268

237269
The A2A Java SDK provides a Java client implementation of the [Agent2Agent (A2A) Protocol](https://google-a2a.github.io/A2A), allowing communication with A2A servers. The Java client implementation supports the following transports:

0 commit comments

Comments
 (0)