-
Notifications
You must be signed in to change notification settings - Fork 16
Home
Use Eclipse MicroProfile Config to configure your application
Applications generally need to be configured when deployed. Use Eclipse MicroProfile Config to easily configure your application from a variety of configuration sources such as system properties and the system environment variables.
Java
Most applications need to be configured 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.
The configuration data can come from different locations and in different formats. For example, system properties, system environment variables, properties files or resources, XML files or resources, and even datasources. MicroProfile Config calls these sources of configuration 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 configuration property value.
Sometimes configuration values can change dynamically. Applications need to be able to access the latest configuration values without the need to be restarted. This is particularly important for microservices running in a cloud environment. MicroProfile Config support dynamically updating configuration values.
MicroProfile is a baseline platform definition that optimizes Enterprise Java for a microservices architecture and delivers application portability across multiple MicroProfile runtimes.
BJ Hargrave
https://github.com/IBM/java-microprofile-config
N/A
N/A
The application in this repository demonstrates the features of the MicroProfile Config API on Open Liberty. The code includes using dependency injection to receive configuration including dynamic configuration and converters.
- 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.
- The 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.
- The Open Liberty server delivers the response to the user.
- MicroProfile Config API: Configuration for MicroProfile
- Open Liberty: Open Liberty is an open source implementation of Eclipse MicroProfile and Java EE from IBM. It is the foundation of the WebSphere Liberty app server.
- MicroProfile: Optimize Enterprise Java for a microservices architecture.
- JAX-RS: Java API for RESTful Web Services or JAX-RS is an API specifications for creating web services using the Representational State Transfer (REST) architectural pattern.
- Java: A secure, object-oriented programming language for creating applications.
See https://github.com/IBM/java-microprofile-config/wiki/Blog.