我们正在使用 Netflix feign 连接到下游客户端,但我们的 request.options 连接和读取超时不起作用。
这就是我们将参数传递给构建器的方式
Feign.builder()
.client(new OkHttpClient(okHttpClient))
.encoder(new GsonEncoder())
.decoder(new GsonDecoder())
.options(new Request.Options(connectTimeoutInMS, readTimeoutInMs)
.target(*,*);
我们已将 readTimeout 和 ConnectionTimeout 设置为 1 秒。但我们看到的是,即使目标响应时间超过 1 秒,它也不会超时并继续尝试连接。