In the documentation, an example is provided for implementing WebSocketHandler when processing inbound and outbound messages as independent streams. It specifies using the Mono.zip() method, but this does not work as intended. Instead, Flux.merge() should be used.
Mono.zip() waits for all sources to emit a value before combining them, so if one stream only receives or only sends messages, it may not emit at all. In contrast, Flux.merge() emits as soon as any source emits, making it more suitable for joining independent streams.