feat: implement Streamable HTTP HttpClient transport and improve error handling (#337)

- Add HttpClientStreamableHttpTransport implementing the 2025-03-26 MCP specification
- Add ResponseSubscribers utility for handling different HTTP response body types
- Refactor HttpClientSseClientTransport to use reactive streams instead of FlowSseClient
  - Remove FlowSseClient in favor of reactive stream patterns
  - Use Disposable-based connection management instead of CountDownLatch
  - Replace message endpoint discovery with Sinks.One approach
- Improve error handling by replacing doOnError/onErrorResume with onErrorComplete
- Add test coverage for new Streamable HTTP transport
- Add resiliency tests for connection handling and session invalidation

BREAKING CHANGE: FlowSseClient has been removed in favor of reactive streams

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>

Co-authored-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
This commit is contained in:
Christian Tzolov 2025-06-13 07:05:47 +02:00
commit c711f8315a

View file

@ -79,7 +79,7 @@ public abstract class AbstractMcpAsyncClientResiliencyTests {
host = "http://" + ipAddressViaToxiproxy + ":" + portViaToxiproxy;
}
private static void disconnect() {
static void disconnect() {
long start = System.nanoTime();
try {
// disconnect
@ -96,7 +96,7 @@ public abstract class AbstractMcpAsyncClientResiliencyTests {
}
}
private static void reconnect() {
static void reconnect() {
long start = System.nanoTime();
try {
proxy.toxics().get("RESET_UPSTREAM").remove();
@ -110,7 +110,7 @@ public abstract class AbstractMcpAsyncClientResiliencyTests {
}
}
private static void restartMcpServer() {
static void restartMcpServer() {
container.stop();
container.start();
}