티스토리 뷰

공부

[Java] RestTemplate timeout

승가비 2021. 11. 5. 12:28
728x90
private static RestTemplate restTemplate;

static {
	HttpComponentsClientHttpRequestFactory rf = new HttpComponentsClientHttpRequestFactory();
	rf.setReadTimeout(3 * 1000);
	rf.setConnectTimeout(2 * 1000);

	restTemplate = new RestTemplate(rf);
	restTemplate.getMessageConverters()
		.add(0, new StringHttpMessageConverter(StandardCharsets.UTF_8));
}

https://stackoverflow.com/questions/13837012/spring-resttemplate-timeout

 

Spring RestTemplate timeout

I would like to set the connection timeouts for a rest service used by my web application. I'm using Spring's RestTemplate to talk to my service. I've done some research and I've found and used t...

stackoverflow.com

https://zepinos.tistory.com/34

 

RestTemplate 설정 변경하기

Spring 에서 제공하는 RestTemplate 을 이용하면 다른 URL 을 호출하고 결과를 받아오는 코드를 쉽게 작성할 수 있습니다. 기존에는 Apache Commons 의 http 을 많이 이용했으나, Spring 에서 제공하는 RestTempla.

zepinos.tistory.com

https://inyl.github.io/programming/2017/12/02/timeout.html

 

Connection timeout과 Read timeout 차이 쉽게 정리

– 유치함주의 – 봉팔이는 유명맛집을 인터넷에서 검색하고 맛집에 찾아갑니다. 예상대로 맛집에는 이미 많은 사람들이 찾아와 북적이고 대기열도 한가득 있었습니다. 성질급한 봉팔이는 “

inyl.github.io

 

728x90

'공부' 카테고리의 다른 글

[Linux] File encoding  (0) 2021.11.05
[Java] JVM encoding  (0) 2021.11.05
[Github] Creating a personal access token  (0) 2021.09.11
[Java][Spark] dataframe to csv  (0) 2021.09.11
[Java][Spark] rows to dataframe  (0) 2021.09.11
댓글