Eclipse MicroProfile Config enables you to modify application configuration data from different sources without having to repackage the application. The application in this repository demonstrates the features of the Eclipse MicroProfile Config API on Open Liberty. The code includes the use of dependency injection to receive dynamic configuration and converters.
Most applications need to be set up based on a running environment. It must be possible to modify configuration data from outside an application so that the application itself does not need to be repackaged.
Configuration data can come from different locations and in different formats – system properties, system environment variables, properties files or resources, XML files or resources, and even data sources. Eclipse MicroProfile Config calls these sources of data ConfigSources. Since the same configuration property could be defined in multiple ConfigSources, a prioritization can be used to determine which ConfigSource is used for the property value.
Sometimes configuration values can change dynamically. Applications need to be able to access the latest values without restarting. This is particularly important for microservices running in a cloud environment. Eclipse MicroProfile Config supports dynamically updating configuration values.
Eclipse MicroProfile is a baseline platform definition that optimizes Enterprise Java technology for a microservices architecture and delivers application portability across multiple Eclipse MicroProfile Config runtimes.
- User makes a REST request to the Open Liberty server.
- JAX-RS directs the request to the application.
- The application requests configuration data from the Open Liberty server via the MicroProfile Config API.
- Open Liberty server consults the config sources for configuration data.
- The Open Liberty server consults the converters to convert the configuration data into the desired types.
- The application responds to the JAX-RS request with a JSON result.
- Open Liberty server delivers the response to the user.
Find the detailed steps for this pattern in the README.