Skip to content

Commit 2992bb3

Browse files
committed
fix httpclientstreamablehttptransport handleConnectionClosed log
1 parent b26baf9 commit 2992bb3

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

mcp-core/src/main/java/io/modelcontextprotocol/client/transport/HttpClientStreamableHttpTransport.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ private void handleException(Throwable t) {
252252
}
253253

254254
private void handleConnectionClosed() {
255-
logger.debug("Handling connection closed for session {}", sessionIdOrPlaceholder(this.activeSession.get()));
256255
Consumer<Void> handler = this.connectionClosedHandler.get();
257256
if (handler != null) {
258257
handler.accept(null);

mcp-core/src/test/java/io/modelcontextprotocol/client/transport/HttpClientStreamableHttpTransportConnectionClosedHandlingTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ void stopServer() {
101101
void testTransportConnectionClosedHandler() throws URISyntaxException {
102102
AtomicReference<Boolean> closedHandlerCalled = new AtomicReference<>(false);
103103
var transport = HttpClientStreamableHttpTransport.builder(HOST)
104+
.openConnectionOnStartup(true)
104105
.connectionClosedHandler(v -> closedHandlerCalled.set(true))
105106
.build();
106107

0 commit comments

Comments
 (0)