-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: documentationA documentation taskA documentation task
Milestone
Description
Using latest Spring-Boot 3.x, I experimented a bit with @order in the context of Spring-Security on multiple @SecurityFilterChains.
I created 2 @configuration SecurityConfigs, each one with 2 @bean SecurityFilterChain, and later on I debugged the
@Autowired(required = false)
void setFilterChains(List<SecurityFilterChain> securityFilterChains) {
this.securityFilterChains = securityFilterChains;
}
to double-check the injection order.
-
- When annotating only the classes, the annotations do not change the instantiation order of both @configuration classes or its bean-exposing methods, nor the order of injection of those beans.
So I am wondering, what is the point of @order at class level?
-
- Is it doing something or it is expected to not have any effect? Does it depend on the annotated kind of component? (Perhaps it's useless on @Configurations but not on @EventListeners, etc.. If so I think it would be nice to have it documented
-
- Am I perhaps facing a bug? If so I'll create the issue in this github or spring-security one if hat's the culprit
-
- A very important relevant nuance that should be documented in my opinion is whether the @order annotation is that kind of annotation that when put at class level behaves like an alias for annotating all its methods, or on the contrary, it has semantics on its own. If so, I think they should be documented for @configuration classes context at least
Thanks a lot!
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: documentationA documentation taskA documentation task