- Configuration
package org.blog.test; import lombok.extern.slf4j.Slf4j; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.web.client.RestTemplate; @SpringBootApplication @Slf4j public class RestTemplateApplication { public static void main(String[] args) { SpringApplication.run(RestTemplateApplication.class, args); } @Bean public RestTemplate restTemplate() { return new RestTemplate() {{ setRequestFactory(new HttpComponentsClientHttpRequestFactory(HttpClientBuilder .create() .setConnectionManager(new PoolingHttpClientConnectionManager() {{ setDefaultMaxPerRoute(20); setMaxTotal(200); }}).build())); }}; } }
hello
답글삭제hi
삭제Yo
답글삭제