Method getMergedProperties in ReloadableResourceBundleMessageSource does not set fileTimestamp [SPR-14583] #19152
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Igor Stepanov opened SPR-14583 and commented
Hello Spring team,
I'd like to use ReloadableResourceBundleMessageSource to implement REST service to access localized content. And to achieve best performance, I'd like to support caching with "if-modified-since". So the idea is to rely on PropertiesHolder.getFileTimestamp() method to understand if some of the underlying property files was updated or not.
I've extended ReloadableResourceBundleMessageSource and call next method:
However in current implementation property fileTImestamp is initialized with -1 and never gets updated, so it's not really useful. What do you think about updating it with latest fileTimestamp of the PropertiesHolder instances which are merged into this one?
Moreover, what about adding some setPropertiesChangedCallback() method to make it possible to subscribe to the file updates? In my case this change will allow to push changes to consumer through some message bus and prevent repeated checking through REST interface.
Affects: 4.3.2
Issue Links:
The text was updated successfully, but these errors were encountered: