RestTemplate — default timeout value

前端 未结 4 1535
礼貌的吻别
礼貌的吻别 2020-12-25 11:13

What is the default timeout value when using Spring\'s RestTemplate?

For e.g., I am invoking a web service like this:

RestTemplate restT         


        
4条回答
  •  盖世英雄少女心
    2020-12-25 12:08

    I think you can use SimpleClientHttpRequestFactory for timeout parameter. Instance of SimpleClientHttpRequestFactory can be set to rest template by constructor or setter method.

    By default RestTemplate uses SimpleClientHttpRequestFactory so may be you can directly set value to restTemplate.

提交回复
热议问题