0

我有两个在openshift上运行的spring boot 应用程序。openshift 上每条路线的超时设置2 分钟。我正在使用Resttemplate并将connectiontimeout/readtimeout设置为2 分钟

我的测试场景是consumer ==> application 1 ==> application 2 ==> provider。在提供者上,我将睡1.5 分钟,然后将响应发送回应用程序 2。我的期望是端到端会成功,但事实并非如此。应用程序 1 在 1 分钟后得到 org.apache.http.NoHttpResponseException

请注意,这个问题在我的本地没有发生

应用程序 2 在 1.5 分钟后收到提供商的成功响应。如果提供者的响应时间少于 1 分钟。端到端工作成功。

你能帮忙告诉我为什么应用程序 1在我设置超时时间为 2 分钟时得到 NoHttpResponseException 。

请在下面找到我的日志

2021-06-18 16:26:48,151 | DEBUG | http-outgoing-4 << "end of stream"
2021-06-18 16:26:48,152 | DEBUG | http-outgoing-4: Close connection
2021-06-18 16:26:48,154 | DEBUG | http-outgoing-4: Shutdown connection
2021-06-18 16:26:48,154 | DEBUG | Connection discarded
2021-06-18 16:26:48,154 | DEBUG | Connection released: [id: 4][route: {}->***:80][total 
available: 0; route allocated: 0 of 5; total allocated: 0 of 10]
2021-06-18 16:26:48,240 | DEBUG | Error in sendRequest
org.springframework.web.client.ResourceAccessException: I/O error on POST request for "***": 
 ***:80 failed to respond; nested exception is org.apache.http.NoHttpResponseException: 
***:80 failed to respond
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:746)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:672)
at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:416)
4

0 回答 0