Rev 35547 | Blame | Compare with Previous | Last modification | View Log | RSS feed
package com.spice.profitmandi.dao.config;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework.scheduling.annotation.EnableAsync;import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;import java.util.concurrent.Executor;/*** Configuration for async processing of Solr updates.* Enables non-blocking Solr updates when TagListing changes.*/@Configuration@EnableAsyncpublic class AsyncConfig {@Bean(name = "solrUpdateExecutor")public Executor solrUpdateExecutor() {ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();executor.setCorePoolSize(2);executor.setMaxPoolSize(5);executor.setQueueCapacity(100);executor.setThreadNamePrefix("solr-update-");executor.initialize();return executor;}@Bean(name = "mailOutboxExecutor")public Executor mailOutboxExecutor() {ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();executor.setCorePoolSize(2);executor.setMaxPoolSize(5);executor.setQueueCapacity(200);executor.setThreadNamePrefix("mail-outbox-");executor.initialize();return executor;}}