-
Notifications
You must be signed in to change notification settings - Fork 565
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
MicroProfile Config 3.0 #3644
MicroProfile Config 3.0 #3644
Conversation
return findConfigValue(key) | ||
.orElseGet(() -> new ConfigValueImpl(key, null, null, null, 0)); | ||
} | ||
return findConfigValue("%" + configProfile + "." + key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the need for all this String concatenation required by the spec for profiles? Seems like not the fastest option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The specification for profile requires that you first attempt to find the configuration value by the config profile prefix (which implies string concatenation), and then (if not found) you use the original key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caching is not an option, as MP Config requires the values to be always requested from config source(s)
config/config-mp/src/main/java/io/helidon/config/mp/MpConfigImpl.java
Outdated
Show resolved
Hide resolved
microprofile/config/src/main/java/io/helidon/microprofile/config/FieldTypes.java
Outdated
Show resolved
Hide resolved
microprofile/config/src/main/java/io/helidon/microprofile/config/DefaultConfigValue.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some minor comments but otherwise LGTM.
@@ -492,7 +498,12 @@ public Config build() { | |||
|
|||
// nope, return the result | |||
if (configuredProfile == null) { | |||
LOGGER.fine("Built MP config with no profile"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (LOGGER.isLoggable(Level.FINEST)) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed (also it is fine not finest). If the string is a constant, there is not much overhead doing it this way. The guarding of logs statements should only be used when passing variables to output
Implementation of MP Config
Enabled TCK for Config
Fixed all related tests
Resolves #2640