rest-client - Quarkus Rest Client 永远不会超时
问题描述
其余客户端永远不会超时。多次请求后,quarkus 停止服务新请求。还尝试了 .../mp-rest/connectTimeout=5000 .../mp-rest/readTimeout=5000 但没有运气。
界面看起来像
package org.acme;
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
@RegisterRestClient
public interface ExampleClient {
@GET
@Path("/test")
String test();
}
服务喜欢
package org.acme;
import org.eclipse.microprofile.rest.client.inject.RestClient;
import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
@Path("/hello")
public class ExampleResource {
@Inject
@RestClient
ExampleClient exampleClient;
@GET
@Produces(MediaType.TEXT_PLAIN)
public String hello() {
return exampleClient.test();
}
}
和 application.properties 文件,如
org.acme.ExampleClient/mp-rest/url=http://localhost:8081
org.acme.ExampleClient/mp-rest/connectTimeout=5000
org.acme.ExampleClient/mp-rest/readTimeout=5000
为了测试,调用http://localhost:8080/hello并将 localhost:8081 指向带有断点的调试模式下的服务。
我已经在 quarkus 0.22 和 0.23.2 上进行了测试。
解决方案
这个问题现在在几天前发布的 0.27 中得到了解决
推荐阅读
- c++ - 花括号初始化程序后的向量 push_back 在 C++ 中不起作用
- mysql - 由于 SSL 问题,无法通过 docker-compose 将 Keycloak 连接到 MySQL
- c# - 我想用方形网格统一绘制游戏板,我是初学者
- python - training.test.split 返回空的训练集
- python - 在 Python 中使用 InfluxDB 差分函数
- apache-spark - 缓存 pyspark 数据帧不会导致性能提升
- c++ - 错误:字符串之前的预期主表达式
- c++ - 如何在 C++ 中使用 unsigned char 数组创建 streambuf
- math - 如何计算箭头填充时钟所有给定扇区所需的步数?
- c# - 如何使用 C# 进行 OAuth 1 Twitter API 调用(dotnet core 3.1)