I am using Reactor (Spring5 WebClient) as my reactive programming API. I have 2 REST endpoint to call. The result of the first one will be the parameter to the second one. For the second API, it will return a result with "hasMore" value. If this value is true, I should change the pagination parameters and call the second API again. The demo code is the following:
client.getApi1()
.map(r -> r.getResult())
.flatMap(p -> client.getApi2(p, 2(page size), 1(page start)))
.subscribe(r -> System.out.println(r.isHasmore()));
How to repeat calling the second API (getApi2) until "hasMore" is false.
Besides, I need to change the parameters page size and page start