Reactor – How to Combine Publishers (Flux/Mono)

In this tutorial, JavaSampleApproach introduce ways to combine two or more Reactor Publishers (Flux/Mono).

I. Ways to combine Publishers

0. Initialization
0.1 Reactor installation in Maven

– First, import the BOM by adding the following to pom.xml:

– Next, add dependency:

0.2 Declare & Initialize Publishers

1. Concat methods

reactor-combine-publishers-concat

1.1 Flux#concat

1.2 Flux.concatWith

2. Zip methods

reactor-comabine-publishers-zip

2.1 Flux#zip

2.2 Flux.zipWith

3. Merge methods

reactor-combine-publishers-merge

3.1 Flux#merge

3.2 Flux.mergeWith

II. Source Code

1. Technology

– Java 8
– Maven 3.6.1
– Reactor Core 3.0.4, with the Aluminium release train.

2. Code

3. Results

By JavaSampleApproach | June 29, 2017.


Related Posts


Got Something To Say:

Your email address will not be published. Required fields are marked *

*