spring-cloud-aws-messaging/src/main/java/org/springframework/cloud/aws/messaging/listener/NonBlockingMessageListenerContainer.java
protected AsyncTaskExecutor createDefaultTaskExecutor() {
		String beanName = getBeanName();
		ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
		threadPoolTaskExecutor.setThreadNamePrefix(beanName != null ? beanName + "-" : DEFAULT_THREAD_NAME_PREFIX);
		int spinningThreads = this.getRegisteredQueues().size();

		if (spinningThreads > 0) {
			threadPoolTaskExecutor.setCorePoolSize(spinningThreads * DEFAULT_WORKER_THREADS);

			int maxNumberOfMessagePerBatch = getMaxNumberOfMessages() != null ? getMaxNumberOfMessages() : DEFAULT_WORKER_THREADS;
			threadPoolTaskExecutor.setMaxPoolSize(spinningThreads * maxNumberOfMessagePerBatch);
		}

		// No use of a thread pool executor queue to avoid retaining message to long in memory
		threadPoolTaskExecutor.setQueueCapacity(0);
		threadPoolTaskExecutor.afterPropertiesSet();

		return threadPoolTaskExecutor;

	}
/**
	 * Create a default TaskExecutor. Called if no explicit TaskExecutor has been specified.
	 * <p>The default implementation builds a {@link org.springframework.core.task.SimpleAsyncTaskExecutor}
	 * with the specified bean name (or the class name, if no bean name specified) as thread name prefix.
	 *
	 * @return a {@link org.springframework.core.task.SimpleAsyncTaskExecutor} configured with the thread name prefix
	 * @see org.springframework.core.task.SimpleAsyncTaskExecutor#SimpleAsyncTaskExecutor(String)
	 */
Create a default TaskExecutor. Called if no explicit TaskExecutor has been specified.
The default implementation builds a  org.springframework.core.task.SimpleAsyncTaskExecutor
with the specified bean name (or the class name, if no bean name specified) as thread name prefix.


Create a default TaskExecutor . Called if no explicit TaskExecutor has been specified . The default implementation builds a org . springframework . core . task . SimpleAsyncTaskExecutor with the specified bean name ( or the class name if no bean name specified ) as thread name prefix .
protected AsyncTaskExecutor createDefaultTaskExecutor() {
		String beanName = getBeanName();
		ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
		threadPoolTaskExecutor.setThreadNamePrefix(beanName != null ? beanName + "-" : DEFAULT_THREAD_NAME_PREFIX);
		int spinningThreads = this.getRegisteredQueues().size();
		if (spinningThreads > 0) {
			threadPoolTaskExecutor.setCorePoolSize(spinningThreads * DEFAULT_WORKER_THREADS);
			int maxNumberOfMessagePerBatch = getMaxNumberOfMessages() != null ? getMaxNumberOfMessages() : DEFAULT_WORKER_THREADS;
			threadPoolTaskExecutor.setMaxPoolSize(spinningThreads * maxNumberOfMessagePerBatch);
		}
		threadPoolTaskExecutor.setQueueCapacity(0);
		threadPoolTaskExecutor.afterPropertiesSet();
		return threadPoolTaskExecutor;
	}
protected AsyncTaskExecutor createDefaultTaskExecutor ( ) { String beanName = getBeanName ( ) ; ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor ( ) ; threadPoolTaskExecutor . setThreadNamePrefix ( beanName != null ? beanName + "-" : DEFAULT_THREAD_NAME_PREFIX ) ; int spinningThreads = this . getRegisteredQueues ( ) . size ( ) ; if ( spinningThreads > 0 ) { threadPoolTaskExecutor . setCorePoolSize ( spinningThreads * DEFAULT_WORKER_THREADS ) ; int maxNumberOfMessagePerBatch = getMaxNumberOfMessages ( ) != null ? getMaxNumberOfMessages ( ) : DEFAULT_WORKER_THREADS ; threadPoolTaskExecutor . setMaxPoolSize ( spinningThreads * maxNumberOfMessagePerBatch ) ; } threadPoolTaskExecutor . setQueueCapacity ( 0 ) ; threadPoolTaskExecutor . afterPropertiesSet ( ) ; return threadPoolTaskExecutor ; }
Create a default TaskExecutor.
Create a default TaskExecutor .
// No use of a thread pool executor queue to avoid retaining message to long in memory