You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Spring Boot WebFlux+R2DBC+PostgreSQL接口无响应求助

Spring Boot WebFlux + R2DBC + PostgreSQL: REST Interfaces Stuck in Loading, No Response Returned

Hey folks, I'm working on a project using Spring Boot WebFlux with R2DBC and PostgreSQL. I've got my local PostgreSQL database configured properly, and I've added all the required dependencies and plugins as specified.

Here's the issue I'm stuck on:

  • My getResourcesMethod1 works fine—it can delete and insert data into the database without any problems.
  • But both of my REST interfaces refuse to return a response. When testing with Postman, it just stays in a loading/buffering state indefinitely.
  • On top of that, when I print the Flux object returned by getResourcesMethod2, it shows up as FluxOnErrorResume instead of the expected FluxArray. I suspect this might be related to my database configuration, but I can't track down the root cause.

I'm pulling my hair out trying to figure this out—would anyone have any ideas or debugging steps I can take? A few things I'm already wondering about:

  • Did I mess up the reactive return types in my Repository or controller methods? Like, accidentally calling block() somewhere that's blocking the reactive pipeline?
  • Is there a mistake in my R2DBC connection URL? I know R2DBC uses a different format than JDBC (r2dbc:postgresql://...), but I thought I had that right.
  • Could the FluxOnErrorResume mean there's an exception being swallowed somewhere that's keeping the Flux from emitting data? Should I add a doOnError to log any hidden exceptions?
  • Are my controller methods correctly returning Flux/Mono without any accidental blocking operations?
  • Might there be an uncommitted transaction hanging around that's preventing the query from completing?

Any help would be massively appreciated!

内容的提问来源于stack exchange,提问作者iuhettiarachchi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.07 15:58:14