【发布时间】:2022-12-16 16:22:32
【问题描述】:
我正在尝试将资源与 spring webClient 同步:
this.semaphore.acquire()
webClient
.post()
.uri("/a")
.bodyValue(payload)
.retrieve()
.bodyToMono(String.class)
// release
.doFinally(st -> this.semaphore.release())
.switchIfEmpty(Mono.just("a"))
.onErrorResume(Exception.class, e -> Mono.empty())
.doOnNext()
.subscribe();
doFinally 是否足以处理发布?
如果不是,“逃生”点是什么?
【问题讨论】:
标签: project-reactor spring-webclient