@Test void testWithDefaultTaskExecutorAndOneHandler() throws Exception { int testedMaxNumberOfMessages = 10; Map<QueueMessageHandler.MappingInformation, HandlerMethod> messageHandlerMethods = Collections .singletonMap(new QueueMessageHandler.MappingInformation( Collections.singleton("testQueue"), SqsMessageDeletionPolicy.ALWAYS), null); SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(); QueueMessageHandler mockedHandler = mock(QueueMessageHandler.class); AmazonSQSAsync mockedSqs = mock(AmazonSQSAsync.class, withSettings().stubOnly()); when(mockedSqs.getQueueAttributes(any(GetQueueAttributesRequest.class))) .thenReturn(new GetQueueAttributesResult()); when(mockedSqs.getQueueUrl(any(GetQueueUrlRequest.class))) .thenReturn(new GetQueueUrlResult().withQueueUrl("testQueueUrl")); when(mockedHandler.getHandlerMethods()).thenReturn(messageHandlerMethods); container.setMaxNumberOfMessages(testedMaxNumberOfMessages); container.setAmazonSqs(mockedSqs); container.setMessageHandler(mockedHandler); container.afterPropertiesSet(); int expectedPoolMaxSize = messageHandlerMethods.size() * (testedMaxNumberOfMessages + 1); ThreadPoolTaskExecutor taskExecutor = (ThreadPoolTaskExecutor) container .getTaskExecutor(); assertThat(taskExecutor).isNotNull(); assertThat(taskExecutor.getMaxPoolSize()).isEqualTo(expectedPoolMaxSize); }
protected AsyncTaskExecutor getTaskExecutor() { return this.taskExecutor; }
SimpleMessageListenerContainer extends AbstractMessageListenerContainer { protected AsyncTaskExecutor getTaskExecutor() { return this.taskExecutor; } }
SimpleMessageListenerContainer extends AbstractMessageListenerContainer { protected AsyncTaskExecutor getTaskExecutor() { return this.taskExecutor; }  }
SimpleMessageListenerContainer extends AbstractMessageListenerContainer { protected AsyncTaskExecutor getTaskExecutor() { return this.taskExecutor; }  void setTaskExecutor(AsyncTaskExecutor taskExecutor); long getBackOffTime(); void setBackOffTime(long backOffTime); long getQueueStopTimeout(); void setQueueStopTimeout(long queueStopTimeout); void stop(String logicalQueueName); void start(String logicalQueueName); boolean isRunning(String logicalQueueName); }
SimpleMessageListenerContainer extends AbstractMessageListenerContainer { protected AsyncTaskExecutor getTaskExecutor() { return this.taskExecutor; }  void setTaskExecutor(AsyncTaskExecutor taskExecutor); long getBackOffTime(); void setBackOffTime(long backOffTime); long getQueueStopTimeout(); void setQueueStopTimeout(long queueStopTimeout); void stop(String logicalQueueName); void start(String logicalQueueName); boolean isRunning(String logicalQueueName);  }