- 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.
- 自動(dòng)駕駛網(wǎng)絡(luò):自智時(shí)代的網(wǎng)絡(luò)架構(gòu)
- 物聯(lián)網(wǎng)短距離無線通信技術(shù)應(yīng)用與開發(fā)
- 工業(yè)控制網(wǎng)絡(luò)安全技術(shù)與實(shí)踐
- Go Web Scraping Quick Start Guide
- PLC、現(xiàn)場總線及工業(yè)網(wǎng)絡(luò)實(shí)用技術(shù)速成
- 2018網(wǎng)信發(fā)展報(bào)告
- 電力物聯(lián)網(wǎng)工程技術(shù)原理與應(yīng)用
- Microservice Patterns and Best Practices
- 夢(mèng)工廠之材質(zhì)N次方:Maya材質(zhì)手冊(cè)
- 紅藍(lán)攻防:構(gòu)建實(shí)戰(zhàn)化網(wǎng)絡(luò)安全防御體系
- Scala Design Patterns.
- 高級(jí)網(wǎng)絡(luò)技術(shù)
- Hands-On Microservices with Node.js
- 局域網(wǎng)組成實(shí)踐
- TCP/IP基礎(chǔ)(第2版)