- Hands-On Enterprise Java Microservices with Eclipse MicroProfile
- Cesar Saavedra Heiko W. Rupp Jeff Mesnil Pavol Loffay Antoine Sabot Durand Scott Stark
- 254字
- 2021-06-24 12:56:20
Understanding Eclipse MicroProfile Config
Every application needs some external configuration to adapt its behavior to the runtime platform it's running on. It can range from the HTTP endpoints that the application must connect to, or the size of some internal structures.
These configuration parameters can also come from different sources:
- From the operating system or the container in a cloud-native environment (through the use of environment variables)
- From the Java virtual machine (with system properties)
- From some external configuration files (such as the Java properties file)
- From other places (an LDAP server, database, key-value store, and so on)
On the one hand, these configuration parameters come from many different sources. On the other hand, we want to consume them in the Java application in a simple way that does not depend on the source of the configuration. The Eclipse MicroProfile Config specification addresses this problem.
The MicroProfile Config API is split into two parts that tackle the two sides of the problem:
- The API defines the Config and @ConfigProperty types that are used by the Java application to get the values of the configuration parameters.
- The API also defines a Service Provider Interface (SPI) to let other projects (or the Java application itself) provide the sources of configuration parameters.
Implementations of MicroProfile Config must provide default ConfigSource implementations that are always available to the application.
For most use cases, the application will mainly be interested in reading configuration from the Config API, which we will cover in the next section.
- 網(wǎng)絡云百問百答
- 物聯(lián)網(wǎng)工程規(guī)劃技術(shù)
- Truffle Quick Start Guide
- INSTANT PhpStorm Starter
- Learning QGIS 2.0
- 計算機網(wǎng)絡安全實訓教程(第二版)
- 農(nóng)產(chǎn)品物聯(lián)網(wǎng)研究與應用
- 互聯(lián)網(wǎng)安全的40個智慧洞見:2015年中國互聯(lián)網(wǎng)安全大會文集
- SSL VPN : Understanding, evaluating and planning secure, web/based remote access
- 計算機網(wǎng)絡與通信(第2版)
- 雷達饋線技術(shù)
- Building RESTful Web services with Go
- WordPress Web Application Development
- CCNP TSHOOT(642-832)認證考試指南
- 網(wǎng)管工具使用與技巧大全