feat: auto-configure virtual threads for SQS listener containers - #1695
feat: auto-configure virtual threads for SQS listener containers#1695Theprathamshah wants to merge 2 commits into
Conversation
e5cf262 to
575275d
Compare
|
@Theprathamshah , thanks for the PR. Let's keep this PR scoped to SQS, and please open a separate one for Kinesis and other integrations. |
|
@tomazfernandes Sure let me create separate PR for kinesis. |
575275d to
30f6289
Compare
|
@tomazfernandes I've separated the changes as discussed. This PR focuses exclusively on the SQS listener container auto-configuration (the Kinesis changes are in #1696). Both are ready for review whenever you have time. Thanks! |
|
Hi @tomazfernandes @MatejNedic ,just following up to see if you have any feedback or suggestions on this PR when you get a moment. Also, could you please approve the CI workflow when convenient so we can ensure the automated checks pass? Thanks! |
|
@Theprathamshah I approved the CI workflow for this PR. There seems to be some failing tests, please take a look. |
|
Hi @tomazfernandes, thanks for pointing that out! I've updated the tests to use reflection for isVirtual() and added @EnabledForJreRange(min = JRE.JAVA_21) so they compile and run cleanly across the entire JDK 17 / 21 / 24 matrix. |
📢 Type of change
📜 Description
This pull request adds native support for Java 21+ Virtual Threads to SQS listener container factories.
SqsAutoConfigurationto detect the standard Spring Boot propertyspring.threads.virtual.enabled.SimpleAsyncTaskExecutor(withvirtualThreads = true) for both the message processing executor (componentsTaskExecutor) and the acknowledgment executor (acknowledgementResultTaskExecutor).💡 Motivation and Context
Closes #1693.
Integrates Spring Boot's global standard
spring.threads.virtual.enabledtoggle directly into Spring Cloud AWS SQS listeners, allowing users to leverage high-throughput non-blocking concurrency (Project Loom) out-of-the-box on Java 21+ stacks.💚 How did you test it?
SqsAutoConfigurationTestverifying SQS containers operate on virtual threads when enabled and fallback to standard platform thread execution when disabled.