3
我在Spring 3.1中使用Spring MVC。我有一個使用許多REST服務的Web應用程序。其中一項REST服務需要長達一小時才能做出響應 - 我無法改變。我有我的設置是這樣設置爲60分鐘超時RestTemplate超時:Spring MVC - 如何爲我的resttemplates使用不同的超時?
<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調用來一組不同的超時。任何想法如何做到這一點?
感謝,
添
情況還是一樣嗎?你的答案現在已經超過4年了,也許春天有一些更新? –
@HonzaZidek查看當前['RestTemplate'](https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/client/RestTemplate.html)API,我不'不會看到任何可以讓您爲每個請求設置超時的內容。 –