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

Interface-based configuration #334

Closed
hwellmann opened this issue Mar 26, 2018 · 1 comment
Closed

Interface-based configuration #334

hwellmann opened this issue Mar 26, 2018 · 1 comment

Comments

@hwellmann
Copy link

Feature request

Support interface-based configuration.

This is already implemented in Apache DeltaSpikeConfiguration.

Example

@ApplicationScoped
@Configuration(prefix = "com.example.myapp.client.")
public interface MyConfig {

    @ConfigProperty(name = "url")
    String url();

    @ConfigProperty(name = "timeout", defaultValue = "30000")
    long timeout();
}

Benefits

  • Configuration consumers can simply inject the interface and call its methods.
  • Configuration property names do not get duplicated for each consumer across the application.
@Emily-Jiang Emily-Jiang added this to the MP Config future milestone Apr 16, 2018
@OndroMih
Copy link
Contributor

This is a duplicate of #240, let's discuss there.

I'm closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants