Skip to content

Feature: Configuration Injection #4610

@paullatzelsperger

Description

@paullatzelsperger

Feature Request

Implement a feature that enables configuration injection. By annotating certain field values it should be possible to automatically resolve and set config values, for example:

public class SomeExtension extends ServiceExtension {

    @Setting(key = "edc.some.config.value", required = true, defaultValue = "barbaz")
    private String someConfigValue
}

thus, someConfigValue gets assigned the value of edc.some.config.value, or - lacking that - the default value "barbaz".

In addition, it should be able to group config values together in a configuration object, which is basically a POJO:

public class SomeExtension extends ServiceExtension {

    @Configuration
    private SomeConfigObject configObject;

}

public record SomeConfigObject(@Setting(key="...") String stringValue, 
                               @Setting(key="...") Double doubleValue){

}

Which Areas Would Be Affected?

dependency injection, ultimately the entire code base

Why Is the Feature Desired?

ease of use

Solution Proposal

enhance the InjectionPoint implementations, move some responsibility into the FieldInjectionPoint to allow changing the behaviour in other impls.

Subtasks

Metadata

Metadata

Labels

core featureenhancementNew feature or requeststoryOverarching issue with linked sub-issuestriageall new issues awaiting classification

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions