Closed
Description
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>
.