How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Handling onUncaughtException in Reactive WebSocketHandler Spring Boot 3

calendar_today June 21, 2026 person lafual domain spring-boot

Given the following snippet of code @Component(“myWebSocketHandler”) public class MyWebSocketHandler implements WebSocketHandler { @Override public Mono handle(WebSocketSession session) { return session .send( myFluxSource .doOnError(System.err::println) .onErrorResume(e -> Mono.empty()) .map(p -> p.toString()) ) .doOnError(System.err::println) .onErrorResume(e -> Mono.empty()) } If I interrupt the TCP connection, in order to simulate a comms issue between the client (Javascript WebSocket) and the Spring Boot Reactive server, I get the following stack trace (I replaced IPs with xxx yyy) 2026-0

open_in_new Read original post