[BUG] AzureTokenCredentialAutoConfiguration fails with multiple ThreadPoolTaskExecutors #28525
Closed
3 tasks done
Labels
azure-spring
All azure-spring related issues
bug
This issue requires a change to an existing behavior in the product in order to be resolved.
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
needs-team-attention
Workflow: This issue needs attention from Azure service team or SDK team
Milestone
Describe the bug
If there are multiple
ThreadPoolTaskExecutor
s in the Spring application context, theAzureTokenCredentialAutoConfiguration
fails becausethreadPoolTaskExecutors.ifAvailable(tpe -> factory.setExecutorService(tpe.getThreadPoolExecutor()));
expects that there is not more than one or if there are, one of them is marked as@Primary
.Exception or Stack Trace
To Reproduce
Create Spring Boot Application with two
ThreadPoolTaskExecutor
and Azure Spring Cloud (e.g. Key Vault Secrets enabled).Code Snippet
Expected behavior
If there are more than 1
ThreadPoolTaskExecutor
s, the auto configuration should skip setting one in theDefaultAzureCredentialBuilderFactory
. Simple solution would be to replacethreadPoolTaskExecutors.ifAvailable
bythreadPoolTaskExecutors.ifUnique
.Setup (please complete the following information):
com.azure.spring:spring-cloud-azure-autoconfigure:4.0.0
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
The text was updated successfully, but these errors were encountered: