diff --git a/src/main/java/com/easylead/easylead/config/AsyncConfig.java b/src/main/java/com/easylead/easylead/config/AsyncConfig.java index 33f6aa7..80ee691 100644 --- a/src/main/java/com/easylead/easylead/config/AsyncConfig.java +++ b/src/main/java/com/easylead/easylead/config/AsyncConfig.java @@ -3,17 +3,21 @@ import java.util.concurrent.Executor; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.AsyncConfigurer; +import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @Configuration -public class AsyncConfig { +@EnableAsync +public class AsyncConfig implements AsyncConfigurer, WebMvcConfigurer { @Bean(name = "taskExecutor1") public Executor taskExecutor1() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); - executor.setCorePoolSize(5); - executor.setMaxPoolSize(10); - executor.setQueueCapacity(25); + executor.setCorePoolSize(10); + executor.setMaxPoolSize(50); + executor.setQueueCapacity(100); executor.setThreadNamePrefix("Async-"); executor.initialize(); return executor; @@ -22,9 +26,9 @@ public Executor taskExecutor1() { @Bean(name = "taskExecutor2") public Executor taskExecutor2() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); - executor.setCorePoolSize(5); - executor.setMaxPoolSize(10); - executor.setQueueCapacity(25); + executor.setCorePoolSize(10); + executor.setMaxPoolSize(50); + executor.setQueueCapacity(100); executor.setThreadNamePrefix("Async-2-"); executor.initialize(); return executor; diff --git a/src/main/java/com/easylead/easylead/domain/books/service/AladinService.java b/src/main/java/com/easylead/easylead/domain/books/service/AladinService.java index 8d63f4d..eb46fc6 100644 --- a/src/main/java/com/easylead/easylead/domain/books/service/AladinService.java +++ b/src/main/java/com/easylead/easylead/domain/books/service/AladinService.java @@ -48,7 +48,7 @@ public JsonNode search(String title, String author, String publisher) throws Jso HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("http://www.aladin.co.kr/ttb/api/ItemSearch.aspx?TTBKey="+aladinApiKey+ - "&Query="+ encodedQuery +"&Output=JS")).build(); + "&Query="+ encodedQuery +"&Output=JS&Cover=Big")).build(); log.info(query); @@ -76,7 +76,7 @@ public BookInfoResDTO search(String isbn) throws JsonProcessingException { HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("http://www.aladin.co.kr/ttb/api/ItemLookUp.aspx?TTBKey="+aladinApiKey+ - "&ItemId="+ isbn +"&Output=JS")).build(); + "&ItemId="+ isbn +"&Output=JS&Cover=Big")).build(); HttpClient client = HttpClient.newHttpClient();