Taxonomy Icon

Java

Configure your app using Eclipse MicroProfile Config

Get the code

Summary

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.

Description

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.

Flow

flow

  1. User makes a REST request to the Open Liberty server.
  2. JAX-RS directs the request to the application.
  3. The application requests configuration data from the Open Liberty server via the MicroProfile Config API.
  4. Open Liberty server consults the config sources for configuration data.
  5. The Open Liberty server consults the converters to convert the configuration data into the desired types.
  6. The application responds to the JAX-RS request with a JSON result.
  7. Open Liberty server delivers the response to the user.

Instructions

Find the detailed steps for this pattern in the README.