spring-cloud/spring-cloud-function

ContextFunctionCatalogAutoConfiguration is doing component scan at the wrong phase

snicoll opened this issue · 2 comments

Describe the bug
org.springframework.cloud.function.context.config.ContextFunctionCatalogAutoConfiguration is an auto-configuration that should back off if a FunctionCatalog bean is present. PlainFunctionScanConfiguration is doing component scan, which is a PARSE_CONFIGURATION business. You can't scan for additional beans that should happen early and prevent that from happening if a bean is present.

Sample
This will fail in Spring Framework 6.2.0-M1 onwards as we've tighten up that rule, see spring-projects/spring-framework#23206. As such, I am expecting the tests of this project to fail when building against Spring Framework 6.2.

I am not sure I fully understand the issue. The FunctionCatalog is created by ContextFunctionCatalogAutoConfiguration, so it will always be present. So I am not sure what do you mean when you say back off if a FunctionCatalog bean is present.

What am I missing?