MicroProfile Config also supports injection via a JSR-330 DI container:
@Inject @ConfigProperty(name="myproject.some.endpoint.url"); private String restUrl;
The following types can be injected:
T where T is a Type where a org.eclipse.microprofile.config.spi.Converter exists and the
property must exist.Optional<T> where T is a Type where a org.eclipse.microprofile.config.spi.Converter
exists where the property may exist.Provider<T> where T is a Type where a org.eclipse.microprofile.config.spi.Converter
exists where the property may exist.| Modifier and Type | Annotation and Description |
|---|---|
| public @interface | ConfigProperties
Retrieve a number of related configuration properties with the specified prefix into a property class. |
| public @interface | ConfigProperty
Binds the injection point with a configured value. |