gpt4 book ai didi

java - 是否可以使用 DSL 将 bean id 分配给 spring 集成入站适配器

转载 作者:行者123 更新时间:2023-11-30 06:47:44 31 4
gpt4 key购买 nike

使用 SI XML 分配 id 很简单,如下所示

<int-ftp:inbound-channel-adapter id="ftpInbound"
channel="ftpChannel" session-factory="ftpClientFactory"
filename-pattern="*.txt" auto-create-local-directory="true"
delete-remote-files="false" remote-directory="${remotedir}"
local-directory="/apps/wfg/ftp/test" auto-startup="true">
<int:poller fixed-rate="1000">
<int:transactional synchronization-factory="syncFactory" />
</int:poller>
</int-ftp:inbound-channel-adapter>

下面的 dsl 代码也可以做同样的事情吗?

IntegrationFlow flow = IntegrationFlows
.from(Ftp
.inboundAdapter(csf)
.preserveTimestamp(true)
.remoteDirectory(feed.getRemoteDirectory())
.regexFilter(feed.getRegexFilter())
.deleteRemoteFiles(feed.getDeleteRemoteFiles())
.autoCreateLocalDirectory(
feed.getAutoCreateLocalDirectory())
.localFilenameExpression(
feed.getLocalFilenameExpression()).get();

在这种情况下也可以完成相同的过渡同步。

最佳答案

IntegrationFlow flow = IntegrationFlows.from(Ftp.inboundAdapter(sessionFactory())
.preserveTimestamp(true)
.remoteDirectory("ftpSource")
.regexFilter(".*\\.txt$")
.localFilename(f -> f.toUpperCase() + ".a")
.localDirectory(getTargetLocalDirectory()),
e -> e.id("ftpInboundAdapter")
.poller(Pollers.fixedDelay(100)
.transactionSynchronizationFactory(syncFactory())))
.channel(out)
.get();

关于java - 是否可以使用 DSL 将 bean id 分配给 spring 集成入站适配器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43382872/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com