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

work.shashank.configuration.AsynchConfiguration Maven / Gradle / Ivy

The newest version!
package work.shashank.configuration;

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
@EnableAsync
public class AsynchConfiguration {

    @Bean(name = "asyncExecutor")
    public Executor asyncExecutor() {
        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        executor.setCorePoolSize(5);
        executor.setMaxPoolSize(5);
        executor.setQueueCapacity(100);
        executor.setThreadNamePrefix("EntityEvent-");
        executor.initialize();
        return executor;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy