I have a question about message bean creation in springboot 3.0.
This is a situation where the message bundle file path is specified externally and imported as "file:{path}".
- basename Setting
spring.messages.basename=file:{path}
At this time, a ResourceBundleMessageSource object was automatically created according to the message bean creation method provided by Springboot by default.
Then, some servers successfully loaded the message basename,
while other servers failed to retrieve the basename and an error occurred.
- first Server
private MessageSource messageSource;
...
this.messageSource = messageSource;
...
So, I changed the messageSource implementation object to ReloadableResourceBundleMessageSource and created the message bean, and I was able to get the basename normally.
- second Server
@Bean
public MessageSource messageSource() {
ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
messageSource.setBasename(/*get spring.messages.basename*/);
return messageSource;
}
Why couldn't I get the file path message basename from the second server to the ResourceBundleMessageSource object?
In this regard, I would appreciate it if you could provide hints, learning sites, or even keywords.