-
Notifications
You must be signed in to change notification settings - Fork 8
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
Custom URI based loading of sources extension idea #175
Comments
So my discussion with @SentryMan does not get lost in the abyss that is discord: [13:52 - 13:58] agentgt:
[13:58] SentryMan:
[13:59 - 14:04] agentgt:
[14:08 - 14:18] agentgt:
[14:22 - 14:26] agentgt:
Sorry for poor formatting! |
So I still have not fully replaced our home grown config with
avaje-config
because of one feature that I can't decide whether to just work around or have it implemented inavaje-config
.What we have in our system that Avaje does not is we have a
file nameresource path extension.Basically allow custom loading of resources using URIs. This may already be built with the resource loading SPI but I don't think so.
What I mean by that is we do things like using
load.properties
as an example:I think the classpath one is obvious and builtin but the
env
one is builtin for us but I would implement as an extension.What the environment URI one does is find all environment variables starting with
MY_PROJECT_PREFIX_DATABASE_
and replace that starting withDATABASE_
. (it does occur to me that perhaps my real use case need is something that just transforms key names but let us just work through this more abstract feature).Basically internally we have a Map of URI schema to Config loader which is SPI discovered.
// ignore names... you know the bikeshed avoidance drill
Obviously no schema found and it does whatever the defaults are. I realize this adds some more bloat but I think it is not that bad given we have now consolidated service loading to a single call (thank you @SentryMan ).
The text was updated successfully, but these errors were encountered: