【发布时间】:2019-12-23 09:02:25
【问题描述】:
我从可迭代对象中创建了平行通量。在每个迭代中,我都必须打一个休息电话。但是在执行时,即使任何请求失败,所有剩余的请求也会失败。无论成功与否,我都希望执行所有请求。
我目前正在使用 Flux.fromIterable 并使用 runOn 运算符
Flux.fromIterable(actions)
.parallel()
.runOn(Schedulars.elastic())
.flatMap(request -> someRemoteCall)
.sequential()
.subscribe();
我希望执行 iterable 中的所有请求,无论失败或成功。但截至目前,有些被执行,有些失败。
【问题讨论】:
-
已添加顺序作为命中和试验的一部分。
-
这是我在日志中看到的。 {"date":"2019-08-17T08:41:48.043+00:00","loglevel":"ERROR","logger_name":"reactor.core.publisher.Operators","thread_name":"reactor- http-client-epoll-11","message":"操作者调用默认 onErrorDropped","stack_trace":"org.springframework.web.reactive.function.client.WebClientResponseException: ClientResponse 有错误的状态码: 404 Not Found\n \tat
标签: spring-boot spring-webflux project-reactor