SpringBoot 2.4.x Configuration

Kondah Mouad
13 min readApr 6, 2021

In their new release, Spring decided to change the logic behind loading configuration files.

To represent elements that may contribute to the environment, a ConfigDataEnvironmentContributor is introduced, each contributor would be replaced during the process.

Spring decided to use a tree as a data structure in order to process/apply the configuration data.

I will refer to ConfigDataEnvironmentContributor as CDEContributor.

Contributors tree

Each contributor can imports some properties (more on that later), and it will be appended as children, thus creating a whole tree.

Each contributor will contain some metadata describing the node:

1. location: a configDataLocation that will be resolved using a configDataLocationResolver to one or more ressources.

2. ressource: each propertySource will be wrapped inside a ConfigData object, ConfigResource is indicating from which ConfigData can be loaded.

3. propertySource: the propertySource linked to this node.

4. children: children contributors, as said before, when a contributor is importing some properties a new contributors will be added as children of this contributor. children are created for each importPhase.

5.kind: there are various…

--

--

Kondah Mouad
Kondah Mouad

Responses (1)