Reputation: 801
I have two following methods Mono<Set<String>> researchTeamField = submissionService.findByResearchTeamField() //returns set of string
and Mono<Set<String>> reviewerTeamField =submissionService.findByReviewerTeamField() //returns set of reviewer string.
I want to combine the result of two set of string into one final mono set string. How can i do it?
Upvotes: 1
Views: 234
Reputation: 636
You can use zip()
static method.
It merges given monos into a new Mono that will be fulfilled when all of the given Monos have produced an item, aggregating their values as defined by the combinator function.
Mono<Set<String>> mergeField = Mono.zip(researchTeamField,reviewerTeamField).map(d -> {
d.getT1().addAll(d.getT2());
return d.getT1();
});
Upvotes: 1