Provide a public API to create a Config/ClientConfig from URL with default fallback #16809
Labels
Module: Config
[OLD]Team: Integration
Source: Community
PR or issue was opened by a community user
Team: Core
Type: Enhancement
Milestone
We'd like to improve Spring Boot so that developers have a chance to customize the
Config
(orClientConfig
before an hazelcast instance is created. If the user provides us a path to a config file, we can load that ourselves and provide the configuration a customizer hook point. That works but we have some xml/yaml knowledge on our side that shouldn't be there IMO.If they don't, which seems to be the usual case since there are several default locations that Hazelcast use, we have no control has the configuration is loaded and the hazelcast instance is created in one go. There's no way to further customize the config before the instance is created.
With Hazelcast 3.x, this is done as part as
HazelcastInstanceFactory#newHazelcastInstance(null)
. For the client part, there isFailoverClientConfigSupport#resolveClientConfig(null)
we could use for the fallback although that feels a bit odd to call that particular method.Since there is already a public API in place to create an instance based on a configuration, I wonder if a public API that would load a config or client config based on an URL would be a nice addition. Either do the same null check with the URL (loading from the default location), or perhaps a separate method (and requiring a non-null URL for the other method) to make that a bit more explicit.
The code that loads from an URL (and make sure to set the relevant
configrationFile
orconfigurationUrl
for reload of the config) is available in Spring Boot if that's on any interest.The text was updated successfully, but these errors were encountered: