i have a console application.i want to read some configuration settings from DB. And these settings should be stored in a global or session variable so i can use the variable through out the application , how can i implement it ? what are the ways ? which channels do i need to use ? and how payload should be stored?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
It's not at all clear what you mean, but you can declare a Map object as a @Bean
(or <bean/>
) and load it up during initialization.
You can then reference it directly in your components by @Autowired
or via SpEL in expressions in integration components: @mapBean['foo']
.