Skip to content

Commit 5ed4946

Browse files
author
Dave Syer
committed
Add spring.messages.cacheSeconds to global config
Fixes gh-625
1 parent 72d7c28 commit 5ed4946

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/MessageSourceAutoConfiguration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ public MessageSource messageSource() {
5858
}
5959
String encoding = this.environment.getProperty("encoding", "utf-8");
6060
messageSource.setDefaultEncoding(encoding);
61+
messageSource.setCacheSeconds(this.environment.getProperty("cacheSeconds",
62+
Integer.class, -1));
6163
return messageSource;
6264
}
6365

spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ content into your application; rather pick only the properties that you need.
8181
# INTERNATIONALIZATION ({sc-spring-boot-autoconfigure}/MessageSourceAutoConfiguration.{sc-ext}[MessageSourceAutoConfiguration])
8282
spring.messages.basename=messages
8383
spring.messages.encoding=UTF-8
84+
spring.messages.cacheSeconds=-1
8485
8586
[[common-application-properties-security]]
8687
# SECURITY ({sc-spring-boot-autoconfigure}/security/SecurityProperties.{sc-ext}[SecurityProperties])

0 commit comments

Comments
 (0)