diff --git a/framework-docs/modules/ROOT/pages/web/webflux-websocket.adoc b/framework-docs/modules/ROOT/pages/web/webflux-websocket.adoc index 5c5dce2a3f9..57248caa817 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux-websocket.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux-websocket.adoc @@ -310,7 +310,7 @@ Java:: Flux source = ... ; Mono output = session.send(source.map(session::textMessage)); <2> - return Mono.zip(input, output).then(); <3> + return input.and(output); <3> } } ---- @@ -338,7 +338,7 @@ Kotlin:: val source: Flux = ... val output = session.send(source.map(session::textMessage)) // <2> - return Mono.zip(input, output).then() // <3> + return input.and(output) // <3> } } ---- diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/socket/WebSocketHandler.java b/spring-webflux/src/main/java/org/springframework/web/reactive/socket/WebSocketHandler.java index 0b0bb07544b..56009942641 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/socket/WebSocketHandler.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/socket/WebSocketHandler.java @@ -63,7 +63,7 @@ import reactor.core.publisher.Mono; * * *

If processing inbound and sending outbound messages are independent - * streams, they can be joined together with the "zip" operator: + * streams, they can be joined together with the "and" operator: * *

  *	class ExampleHandler implements WebSocketHandler {
@@ -83,7 +83,7 @@ import reactor.core.publisher.Mono;
  *			Flux<String> source = ... ;
  * 			Mono<Void> output = session.send(source.map(session::textMessage));
  *
- * 			return Mono.zip(input, output).then();
+ * 			return input.and(output);
  *		}
  *	}
  *