12得票2回答
如何在没有使用Spring Boot的情况下使用Spring WebClient

我只需要能够进行有限的HTTP请求。我看到WebClient是RestTemplate的新替代品。但是似乎没有办法在不引入整个Spring Boot的情况下使用WebClient,而这不是我想要的。是否有方法在没有Spring Boot的情况下使用WebClient?

10得票1回答
使用Spring Reactive WebClient时遇到问题:"WebClientRequestException: Pending acquire queue has reached its maximum size of 1000"。

我正在运行一个微服务API的负载,该API涉及使用Spring Reactive Webclient调用其他微服务API。我正在使用Postman运行器选项卡进行测试。 首先,我使用1500个迭代来运行负载,每个请求都会调用第二个微服务,一切正常,符合预期。 但是,当我使用5000个迭代来...

10得票2回答
使用Spring WebClient,是否可能在GET请求中包含请求体?

我知道在GET请求中发送正文并不是最好的选择,但我正在尝试使用需要正文的现有API。 通过POST发送正文非常简单: webClient.post() .uri("/employees") .body(Mono.just(empl), Employee.cl...

10得票3回答
Spring Boot WebClient停止发送请求

我正在运行一个使用WebClient进行非阻塞和阻塞HTTP请求的Spring Boot应用程序。在应用程序运行一段时间后,所有出站HTTP请求似乎都会卡住。 WebClient用于向多个主机发送请求,但以下是如何初始化并用于向Telegram发送请求的示例: WebClientConfi...

10得票3回答
如何确定Spring WebClient是否使用HTTP/2?

我想知道Spring WebClient是否使用HTTP/2。我该如何确定?

10得票1回答
如何在Spring WebClient builder实例中设置onStatus

我有很多使用Spring的WebClient的onStatus API的方法: @Override public Mono<Accommodation> createAccommodation(CreateAccommodation create) { return we...

10得票1回答
使用Spring的WebClient进行阻塞/同步请求时,使用try/catch捕获异常。

我需要进行同步、阻塞式的请求,我正在使用Spring的WebClient而不是因为后者已经过时的Spring的RestTemplate。在这种情况下,我不需要响应式功能,我只想以简单直接的方式消费REST API,而不需要包含额外的依赖。我有以下代码,它可以正常工作:MyObject obje...

10得票8回答
Spring Boot中找不到ReactiveClientRegistrationRepository

环境:Spring Boot 2.3.1,Java 11 我已经尝试了一些东西(也与Spring的示例应用程序进行了比较),但到目前为止,我还没有成功创建一个需要ReactiveClientRegistrationRepository的WebClient。 启动我的spring-boot应...

9得票1回答
在 Spring Webflux 中设置最大内存大小

在使用WebFlux的Spring Boot应用程序中,我收到了以下错误: org.springframework.core.io.buffer.DataBufferLimitException: 超出了最大字节缓冲限制:262144 我尝试在application.yml中设置限制,...

9得票1回答
ServiceImpl构造函数中的Spring Boot WebClient Builder初始化

我正在尝试按照最佳实践使用WebClient Builder自动装配Webclient,但有些困惑。 以下是我的主应用程序,我在其中创建了一个Webclient Builder,并将其自动装配到我的某个服务类中。 @SpringBootApplication public cla...