Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation note about bootstrap config #14142

Merged
merged 1 commit into from
Jan 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions docs/src/main/asciidoc/writing-extensions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1092,8 +1092,9 @@ lowercased, and re-joined using hyphens (`-`).

A configuration root's class name can contain an extra suffix segment for the case where there are configuration
roots for multiple <<Configuration Root Phases>>. Classes which correspond to the `BUILD_TIME` and `BUILD_AND_RUN_TIME_FIXED`
may end with `BuildTimeConfig` or `BuildTimeConfiguration`, and classes which correspond to the `RUN_TIME` phase
may end with `RuntimeConfig`, `RunTimeConfig`, `RuntimeConfiguration` or `RunTimeConfiguration`.
may end with `BuildTimeConfig` or `BuildTimeConfiguration`, classes which correspond to the `RUN_TIME` phase
may end with `RuntimeConfig`, `RunTimeConfig`, `RuntimeConfiguration` or `RunTimeConfiguration` while classes which correspond
to the `BOOTSTRAP` configuration may end with `BootstrapConfig` or `BootstrapConfiguration`.

Note: The current implementation is still using injection site to determine the root set, so to avoid migration problems, it
is recommended that the injection site (field or parameter) have the same name as the configuration root class until
Expand Down Expand Up @@ -1127,6 +1128,13 @@ A configuration root dictates when its contained keys are read from configuratio
| ✗
| Appropriate for things which affect build and must be visible for run time code. Not read from config at run time.

| BOOTSTRAP
| ✗
| ✓
| ✗
| ✓
| Used when runtime configuration needs to be obtained from an external system (like `Consul`), but details of that system need to be configurable (for example Consul's URL). The high level way this works is by using the standard Quarkus config sources (such as properties files, system properties, etc.) and producing `ConfigSourceProvider` objects which are subsequently taken into account by Quarkus when creating the final runtime `Config` object.

| RUN_TIME
| ✗
| ✓
Expand All @@ -1138,6 +1146,8 @@ A configuration root dictates when its contained keys are read from configuratio

For all cases other than the `BUILD_TIME` case, the configuration root class and all of the configuration groups and types contained therein must be located in, or reachable from, the extension's run time artifact. Configuration roots of phase `BUILD_TIME` may be located in or reachable from either of the extension's run time or deployment artifacts.

IMPORTANT: _Bootstrap_ configuration steps are executed during runtime-init *before* any of other runtime steps. This means that code executed as part of this step cannot access anything that gets initialized in runtime init steps (runtime synthetic CDI beans being one such example).

==== Configuration Example

[source%nowrap,java]
Expand Down