feat(McpAsyncServer): Add non-blocking execution for tools and resources
- Execute tool calls, resource reads and prompt handling in a non-blocking manner using Schedulers.boundedElastic(). This prevents blocking operations from impacting server responsiveness. - Added integration tests to verify non-blocking behavior with tools that make HTTP calls to external services. Related to #48 This is a temp patch until #48 is resolved properly.
This commit is contained in:
parent
b2082a0506
commit
580f95526f
1 changed files with 132 additions and 15 deletions
|
|
@ -28,7 +28,7 @@ The server can be started in two transport modes, controlled by the `transport.m
|
|||
### Stdio Mode (Default)
|
||||
|
||||
```bash
|
||||
java -Dtransport.mode=stdio -jar target/spring-ai-mcp-sample-0.4.0-SNAPSHOT.jar
|
||||
java -Dtransport.mode=stdio -jar target/spring-ai-mcp-sample-0.5.0-SNAPSHOT.jar
|
||||
```
|
||||
|
||||
The Stdio mode server is automatically started by the client - no explicit server startup is needed.
|
||||
|
|
@ -38,7 +38,7 @@ In Stdio mode the server must not emit any messages/logs to the console (e.g. st
|
|||
|
||||
### SSE Mode
|
||||
```bash
|
||||
java -Dtransport.mode=sse -jar target/spring-ai-mcp-sample-0.4.0-SNAPSHOT.jar
|
||||
java -Dtransport.mode=sse -jar target/spring-ai-mcp-sample-0.5.0-SNAPSHOT.jar
|
||||
```
|
||||
|
||||
## Sample Clients
|
||||
|
|
@ -49,7 +49,7 @@ The project includes example clients for both transport modes:
|
|||
```java
|
||||
var stdioParams = ServerParameters.builder("java")
|
||||
.args("-Dtransport.mode=stdio", "-jar",
|
||||
"target/spring-ai-mcp-sample-0.4.0-SNAPSHOT.jar")
|
||||
"target/spring-ai-mcp-sample-0.5.0-SNAPSHOT.jar")
|
||||
.build();
|
||||
|
||||
var transport = new StdioClientTransport(stdioParams);
|
||||
|
|
|
|||
Loading…
Reference in a new issue