forked from spring-projects/spring-boot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support to inherit common properties for configuring multiple beans
It's used for configuring multiple beans (spring-projects#15732), we could extract common or use primary properties as parent now. Take `org.springframework.boot.autoconfigure.data.redis.RedisProperties` for example, given: ``` # primary spring.data.redis: host: 127.0.0.1 port: 6379 # additional additional.data.redis: port: 6380 ``` Then effective properties: ``` additional.data.redis: host: 127.0.0.1 port: 6380 ``` should be bound to `additionalRedisProperties`: ```java @bean(autowireCandidate = false) // do not back off autoconfigured one @ConfigurationProperties(prefix = "additional.data.redis", inheritedPrefix = "spring.data.redis") RedisProperties additionalRedisProperties() { return new RedisProperties(); } ```
- Loading branch information
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters