Announcement Announcement Module
No announcement yet.
ReloadableResourceBundleMessageSource and cacheSeconds ? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • ReloadableResourceBundleMessageSource and cacheSeconds ?


    I read the javadoc of the "ReloadableResourceBundleMessageSource" and did not understand the following:

    This MessageSource implementation is usually slightly faster than ResourceBundleMessageSource, which builds on java.util.ResourceBundle - in the default mode, i.e. when caching forever.

    With "cacheSeconds" set to 1, message lookup takes about twice as long - with the benefit that changes in individual properties files are detected with a maximum delay of 1 second.

    Higher "cacheSeconds" values usually don't make a significant difference.
    I don't get the last sentence! E.g. when I set cacheSeconds to 1 hours it means that message lookup takes as long as with cacheSeconds set to 1 second?

    Hope s.o. can clarify it to me!

    Thanks in advance, Leif

  • #2
    I have the same question, anyone out there who can clarify this?


    • #3
      The sentence seems quite clear to me...

      If you set ANY caching the lookup of the message takes twice the time it would compared to when you DON'T set any cahce seconds.

      Which is quite logical imho. When you don't set caching the class loads the file once and always returns the same value. When you set caching it first check if it needs to reload the file, if yes reload the file if the file has changed. Both checkes take some time.