Skip to content

Commit 6a435fb

Browse files
committed
Improve Mono gateway sample in the doc
1 parent 799802c commit 6a435fb

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

src/reference/asciidoc/gateway.adoc

+18-11
Original file line numberDiff line numberDiff line change
@@ -757,26 +757,33 @@ The following example shows how to create a gateway with Project Reactor:
757757
@MessagingGateway
758758
public interface TestGateway {
759759
760-
@Gateway(requestChannel = "promiseChannel")
761-
Mono<Integer> multiply(Integer value);
760+
@Gateway(requestChannel = "multiplyChannel")
761+
Mono<Integer> multiply(Integer value);
762762
763-
}
763+
}
764764
765-
...
765+
@ServiceActivator(inputChannel = "multiplyChannel")
766+
public Integer multiply(Integer value) {
767+
return value * 2;
768+
}
769+
----
770+
====
766771

767-
@ServiceActivator(inputChannel = "promiseChannel")
768-
public Integer multiply(Integer value) {
769-
return value * 2;
770-
}
772+
where such a gateway can be used in some service which deals with the `Flux` of data:
771773

772-
...
774+
====
775+
[source,java]
776+
----
777+
@Autowired
778+
TestGateway testGateway;
773779
780+
public void hadnleFlux() {
774781
Flux.just("1", "2", "3", "4", "5")
775782
.map(Integer::parseInt)
776783
.flatMap(this.testGateway::multiply)
777784
.collectList()
778-
.subscribe(integers -> ...);
779-
785+
.subscribe(System.out::println);
786+
}
780787
----
781788
====
782789

0 commit comments

Comments
 (0)