Error creating bean WorkflowsProperties

This is a question regarding workflows-service-distribution 8.0.9. The issue is probably there since 8.0.7.

In our setup, spring has an issue creating the bean based on the new properties class WorkflowsProperties. There seems to be some ambiguity regarding resolution of the parameter(s). Here the conflict is with spring-cloud-sleuth, but I suppose this could happen with any other List<String> - bean available in the spring context.

Here is the error:

... Error creating bean with name 'mgmtp.a12.workflows-com.mgmtp.a12.workflows.service.config.WorkflowsProperties': Unsatisfied dependency
expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException:
No qualifying bean of type 'java.util.List<java.lang.String>' available: expected single matching bean but found 4:
spring.sleuth.baggage-keys,spring.sleuth.local-keys,spring.sleuth.propagation-keys,spring.sleuth.log.slf4j.whitelisted-mdc-keys

I tried a couple of things (fiddling with @EnableConfigurationProperties, @Import etc), but noticed that other ConfigurationProperties (e.g. Configuration#DataServicesProperties) are working just fine.

I ended up creating my own WorkflowsProperties, adding @ConstructorBinding and a default value for skipPartialValidationForModels:

package com.mgmtp.a12.workflows.service.config

import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.boot.context.properties.ConstructorBinding
import org.springframework.context.annotation.Primary

@ConstructorBinding
@ConfigurationProperties("mgmtp.a12.workflows")
@Primary
data class WorkflowsProperties(
    val skipPartialValidationForModels: List<String> = emptyList()
)

Of course I strongly dislike this kind of monkey-patching and would be happy to hear about alternative solutions.

Thanks.

Thanks for the detailed report!

We’ll investigate this further in January to figure out if and how we can fix this from A12 side.

Hi @anon67142020,

Sorry about the late reply. We created a ticket (A12-14330) for this issue and will release a fix in an upcoming 2023.02-ext release as well as backport it to our 2022.06 LTS release line.

We’ll keep you posted once the fix is released.

Hi @anon67142020,

We have released the fix in A12 Workflows versions 8.1.3 and 9.1.0 today.

Please let us know here if it resolves the issue for you. Thanks a lot!