August 2019
Intermediate to advanced
256 pages
6h 43m
English
The org.eclipse.microprofile.config.Config interface is the entry point to retrieve configuration in a Java application.
There are two ways to get an instance of Config:
The first (and preferred) way is to use CDI to inject it into the code:
@Inject private Config config;
Config config = ConfigProvider.getConfig();
The Config interface provides two methods to retrieve properties:
getValue(String propertyName, Class propertyType): This method throws a runtime exception if the property is not present in the configuration. This method must be used only for mandatory configuration ...
Read now
Unlock full access