Skip to content

Enhancement: Auto-configure Virtual Threads for SQS/Kinesis Listener Containers #1693

Description

@Theprathamshah

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

  1. In SqsAutoConfiguration, detect if spring.threads.virtual.enabled is set to true.
  2. If enabled and running on JDK 21+, configure the default SqsMessageListenerContainerFactory to use SimpleAsyncTaskExecutor with virtualThreads = true for both componentsTaskExecutor and acknowledgementResultTaskExecutor.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: sqsSQS integration related issuetype: enhancementSmaller enhancement in existing integration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions