Problem
In WebFluxSseServerTransportProvider, the inner class
WebFluxMcpSessionTransport had a TODO comment in the doOnError handler:
// TODO log with sessionid
The error was being logged without any session identifier, making it
difficult to trace which session caused the error in production.
Fix
Added a sessionId field to WebFluxMcpSessionTransport with a
setSessionId() method. The session ID is set immediately after session
creation in handleSseConnection(). The doOnError handler now logs the
session ID along with the error message.
Why
Proper session-aware logging is essential for debugging and monitoring
in production environments with multiple concurrent sessions.
Problem
In
WebFluxSseServerTransportProvider, the inner classWebFluxMcpSessionTransporthad a TODO comment in thedoOnErrorhandler:// TODO log with sessionid
The error was being logged without any session identifier, making it
difficult to trace which session caused the error in production.
Fix
Added a
sessionIdfield toWebFluxMcpSessionTransportwith asetSessionId()method. The session ID is set immediately after sessioncreation in
handleSseConnection(). ThedoOnErrorhandler now logs thesession ID along with the error message.
Why
Proper session-aware logging is essential for debugging and monitoring
in production environments with multiple concurrent sessions.