You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we have some inconsistencies with the use of GlobalConfig by Helidon components. For example WebServer requires the following:
Config config = GlobalConfig.config();
WebServer server = WebServer.builder()
.config(config.get("server"))
But other components, like ObserveFeature, do not require the passing of config. For example the constructor for ObserveFeature.Builder uses GlobalConfig by default:
In general I think discovering config by default is a good thing, and I'm not sure why we are not doing it for WebServer. Some things to consider
Make sure all Helidon components that have config use GlobalConfig by default (including WebServer)
Discuss if we should provide a way to force Builders to NOT use GlobalConfig, so that one may truly build from scratch with no interference.
Discuss if we should require the user to always explicitly set GlobalConfig and not implicitly initialize it. Builders could either fail or conditionally process global config if set.
Once we settle on the preferred pattern for initializing config we need to ensure all archetypes and examples show that (see issue #7628).
The text was updated successfully, but these errors were encountered:
The GlobalConfig is intended for components that are initialized automagically
(such as MetricsRegistry). There are some leftovers from the prototype where we did not support config on APIs. I am not sure we want to pick the config automatically, as our APIs should have the config method and honor it.
ObserveFeature.builder() currently calls ObserveFeature.Builder.config(Config) with GlobalConfig.config().
I just searched for the usage of GlobalConfig in metrics but did not find it.
Can we consider reverting all current SE usages of GlobalConfig for consistency ?
Currently we have some inconsistencies with the use of GlobalConfig by Helidon components. For example WebServer requires the following:
But other components, like
ObserveFeature
, do not require the passing of config. For example the constructor forObserveFeature.Builder
uses GlobalConfig by default:In general I think discovering config by default is a good thing, and I'm not sure why we are not doing it for WebServer. Some things to consider
Once we settle on the preferred pattern for initializing config we need to ensure all archetypes and examples show that (see issue #7628).
The text was updated successfully, but these errors were encountered: