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

Provide a public API to create a Config/ClientConfig from URL with default fallback #16809

Closed
snicoll opened this issue Mar 28, 2020 · 1 comment · Fixed by #16864
Closed
Assignees
Milestone

Comments

@snicoll
Copy link
Contributor

snicoll commented Mar 28, 2020

We'd like to improve Spring Boot so that developers have a chance to customize the Config (or ClientConfig 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 is FailoverClientConfigSupport#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 or configurationUrl for reload of the config) is available in Spring Boot if that's on any interest.

@mmedenjak
Copy link
Contributor

Hi @snicoll ! Thanks for the report. Is this PR something along these lines?
#16386

Also, adding @blazember , maybe he has more ideas. Added the issue into 4.1, hope we will find time to implement it by then, or even sooner in a patch release.

@mmedenjak mmedenjak added this to the 4.1 milestone Mar 31, 2020
@mmedenjak mmedenjak added the Source: Community PR or issue was opened by a community user label Mar 31, 2020
@leszko leszko self-assigned this Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants