All Downloads are FREE. Search and download functionalities are using the official Maven repository.

me.youm.frame.webmvc.config.RestTemplateConfiguration Maven / Gradle / Ivy

There is a newer version: 1.2.5
Show newest version
package me.youm.frame.webmvc.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;

/**
 * RestTemplate
 * @author youta
 */
@Configuration
public class RestTemplateConfiguration {

	@Bean
	public RestTemplate restTemplate() {
		SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
		requestFactory.setConnectTimeout(5000);
		requestFactory.setReadTimeout(3000);
		RestTemplate restTemplate = new RestTemplate(requestFactory);
		return restTemplate;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy