ConfigSource run in the async mode
See original GitHub issueDescription
Recently the vault config source has moved to vertx (instead of okhttp client).
The vault config source has the ability to refresh itself periodically.
We had issue #16021 where properties were attempted to be refreshed in a non blocking thread.
Although calls to vault using the vertx client could return Uni
, we are limited by the ConfigSource
interface that requires a plain Map<String, String>
.
The question here is whether the config source mechanism could be reactive friendly.
An alternative idea is to get a global timer responsible for calling periodically config sources and get them a chance to refresh their cache (if they do implement one). that way we could be blocking on this thread, and if we use non blocking data structures for the different caches, the applicative threads would never be blocked, and never attempt to call vault as a result of getting a config source property injected.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Timer with a configurable poll interval is in interesting option IMHO, as making
ConfigSource
reactive may be tricky@sberyozkin I was thinking more about a central timer facility, where you could register your periodic tasks. the timer facility would be general purpose, not dedicated to config sources. I am surprised actually that none of the existing extensions have already expressed the need. the use case does not exist, or everybody is doing its own
ScheduledExecutorService
?