Fix issue, SSE connection will terminate after 30 seconds (DEFAULT).

This commit is contained in:
zeko.zhang 2025-02-24 18:09:37 +08:00 • committed by Christian Tzolov
commit dac5c545b0

View file

@ -5,6 +5,7 @@
package io.modelcontextprotocol.server.transport;
import java.io.IOException;
import java.time.Duration;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
@ -228,7 +229,7 @@ public class WebMvcSseServerTransport implements ServerMcpTransport {
logger.error("Failed to poll event from session queue: {}", e.getMessage());
sseBuilder.error(e);
}
});
}, Duration.ZERO);
}
catch (Exception e) {
logger.error("Failed to send initial endpoint event to session {}: {}", sessionId, e.getMessage());