Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Configuration Injection #4610

Open
1 of 7 tasks
paullatzelsperger opened this issue Nov 6, 2024 · 0 comments · Fixed by #4633
Open
1 of 7 tasks

Feature: Configuration Injection #4610

paullatzelsperger opened this issue Nov 6, 2024 · 0 comments · Fixed by #4633
Assignees
Labels
core feature enhancement New feature or request story Overarching issue with linked sub-issues triage all new issues awaiting classification
Milestone

Comments

@paullatzelsperger
Copy link
Member

paullatzelsperger commented Nov 6, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core feature enhancement New feature or request story Overarching issue with linked sub-issues triage all new issues awaiting classification
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant