Wpis z mikrobloga

Co będzie bardziej optymalne jeśli wątek nie może trafić do kolejki bo wszystko musi się równolegle wykonywać?

@Configuration
@EnableAsync
public class SpringAsyncConfig implements AsyncConfigurer {

@Override
public Executor getAsyncExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(1);
executor.setMaxPoolSize(Integer.MAX_VALUE);
executor.setQueueCapacity(0);
executor.initialize();
return executor;
}

/* 2 wersja
@Ovverride
public TaskExecutor getAsyncExecutor() {
return new SimpleAsyncTaskExecutor();
}*/

}

test1234
#programowanie #spring #java