原创

循环响应式进行 api 调用的替代方案

温馨提示:
本文最后更新于 2024年04月12日,已超过 37 天没有更新。若文章内的图片失效(无法正常加载),请留言反馈或直接联系我
 webClient.get()
            .uri("/hms/v1/static-cities/"+next)
            .headers(httpHeaders -> httpHeaders.addAll(headers))
            .retrieve()
            .bodyToMono(TripJackResponse.class);

我想重复调用上面的api并获取数据。当API分页时,我会获取标记更新后的“下一个”值的新数据。我必须在每次api调用后更新“下一个”值,并调用 api 来获取下一组数据。我不能在这里使用循环。

                       I tried using repeatedWhen, retry, repeated on the Mono<Object> but the same is being received everytime. I don't think the api call is being called repeatedly. 

                       Is there any alternative to do this.
正文到此结束
热门推荐
本文目录