最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Spring Webflux on Netty: reactive stream hangs (freezesdies) when calling WebClient or Redis - Stack Overflow

programmeradmin0浏览0评论

I've got a couple of simple controllers like this:

@PostMapping(value = "/action", consumes = MediaType.APPLICATION_JSON_VALUE)
public Mono<ResponseEntity<StatusResponse>> action( @RequestBody MyRequest request,
@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authToken) {
        return service.process(request);
    }

and inside a service call there are different reactive streams that at some point reach either a WebClient call - for exmample: RequestHeadersSpec#exchangeToMono , or a Redis operation - for example: ReactiveValueOperations#get

When reactive stream reaches either one of those operations it just hangs. There is no error, there is no empty value. Nothing happens. I've also got a Kafka listener that calls exactly the same service, but there it works absolutely fine. Also, if I call the same code through

publisher.subscribeOn(Schedulers.boundedElastic()).subscribe()

it also works fine. There is also no blocking calls in the code whatsoever.

I could not find any examples of similar behaviour so I have no idea what to do with it. What could possibly be the issue?

发布评论

评论列表(0)

  1. 暂无评论