spring-projects / spring-projects/spring-boot
Make use of configurer pattern consistent
@snicoll is already working on this.
Since Apr 23, 2026.
- Dominant language
- Java
- Stars
- 81.5k
- Forks
- 42.7k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 65
Description
Spring Boot has introduced the concept of configurer when users would like to create custom instances of a given type whilst retaining the behavior of auto-configuration. They can decide to tune settings before and after calling a configure method. They also can pass a sub-class of the type to configure (if possible) to get exactly what the auto-configuration produced, but with a type that may provide customization of protected methods.
I believe https://github.com/spring-projects/spring-boot/issues/5138 is the issue that started this pattern.
Looking at the codebase, we have used this in other parts but some usage are now inconsistent. Here's a summary of where we are:
- JMS has kept the original idea with a
configuremethod that takes the factory and aConnectionFactory. The default instance is created by injecting the configurer and calling configure on it. - Kafka is problematic as a number of customizers are applied manually which means a configure won't do the same thing as the auto-configuration. Users are reporting, for instance, that they lose observability when using this pattern.
- Rabbit:
- has an extra
ContainerCustomizerthat is not applied by the configurer. - has an extra
RabbitTemplateCustomizerthat is not applied by the configurer. - connection factory setup is also such as that it would take quite a bit of code to replicate it.
- has an extra
- Redis is new and is following the pattern for JMS
RestClientBuilderConfigureris sane, with the default builder created by a one-liner from the configurer.RestTemplateBuilderConfigureris sane, with the default builder created by a one-liner from the configurer.
Rabbit and Kafka needs some work to re-align what we intended with the configurer pattern.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.