Skip to content

Inject dependencies into auto-configuration classes more precisely #15751

Closed
@wilkinsona

Description

@wilkinsona

This is an expansion of #15750.

There are a number of places in Boot's auto-configuration where a dependency is injected into a configuration class's constructor and then only used in a single @Bean method. This is inefficient when the @Bean method is conditional and its conditions don't match. For example, BatchAutoConfiguration injects ObjectProvider<JobParametersConverter> into its constructor and then only uses it in jobOperator which will back off if there's an existing JobOperator bean. Another, similar example is RabbitTemplateConfiguration's injection of ObjectProvider<MessageConverter>.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions