感谢您的关注
我在我的项目中使用Spring Integration
,我想从数据库中读取自动启动,远程目录等配置,怎么做?
我的代码如下:
<int-ftp:inbound-channel-adapter id="my-inbound-channel-adapter"
channel="ready-to-process-inbound-tmp-mover"
session-factory="ftp-Session"
auto-create-local-directory="..... read from db......"
delete-remote-files="..... read from db......"
auto-startup="..... read from db......"
filename-regex="..... read from db......"
remote-directory="..... read from db......"
remote-file-separator="/"
local-filename-generator-expression="...stuff code..."
temporary-file-suffix=".writing"
local-directory="..... read from db......">
<int:poller fixed-rate="..... read from db......" error-channel="errorChannel"/>
</int-ftp:inbound-channel-adapter>
答案 0 :(得分:1)
使用SpEL
调用bean中的方法 - #{myConfigBean.autoStartupSetting}
将调用getAutoStartupSetting()
。
或让您的方法返回地图:public Map<?, ?> getSettings()
。
然后#{myConfigBean.settings['autoStartup']}
。