我将 Spring MVC 与 Spring 3.1 一起使用。我有一个使用许多 REST 服务的 Web 应用程序。其中一项 REST 服务最多需要一个小时才能做出响应——我无法更改。我的 RestTemplate 超时设置如下,超时设置为 60 分钟:
<bean id="restTemplate" class="org.springframework.web.client.RestTemplate ">
<constructor-arg>
<bean class="org.springframework.http.client.CommonsClientHttpRequestFactory">
<property name="readTimeout" value="3600000" />
<property name="connectTimeout" value="3600000" />
</bean>
</constructor-arg>
</bean>
我希望能够将我所有的其他 REST 调用设置为一组不同的超时。关于如何做到这一点的任何想法?
谢谢,
蒂姆