Description
Spring Boot 3.2+ introduced the spring.threads.virtual.enabled property to automatically configure Virtual Threads for standard listeners (like Spring Kafka and Spring RabbitMQ).
Currently, Spring Cloud AWS SQS containers can use Virtual Threads if manually configured via container options, but they do not automatically hook into this standard Spring Boot property out-of-the-box.
Proposed Solution
- In
SqsAutoConfiguration, detect if spring.threads.virtual.enabled is set to true.
- If enabled and running on JDK 21+, configure the default
SqsMessageListenerContainerFactory to use SimpleAsyncTaskExecutor with virtualThreads = true for both componentsTaskExecutor and acknowledgementResultTaskExecutor.
- Provide similar automatic fallback in Kinesis message-driven adapters.
This improves startup/concurrency performance out-of-the-box on Java 21 stacks with minimal configuration.
Description
Spring Boot 3.2+ introduced the
spring.threads.virtual.enabledproperty to automatically configure Virtual Threads for standard listeners (like Spring Kafka and Spring RabbitMQ).Currently, Spring Cloud AWS SQS containers can use Virtual Threads if manually configured via container options, but they do not automatically hook into this standard Spring Boot property out-of-the-box.
Proposed Solution
SqsAutoConfiguration, detect ifspring.threads.virtual.enabledis set totrue.SqsMessageListenerContainerFactoryto useSimpleAsyncTaskExecutorwithvirtualThreads = truefor bothcomponentsTaskExecutorandacknowledgementResultTaskExecutor.This improves startup/concurrency performance out-of-the-box on Java 21 stacks with minimal configuration.