Java 是否可以将bean id分配给带有DSL的spring集成入站适配器
使用SI XML分配id如下所示Java 是否可以将bean id分配给带有DSL的spring集成入站适配器,java,spring,spring-integration,Java,Spring,Spring Integration,使用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-direct
<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>
在这种情况下也可以进行相同的过渡同步。谢谢@gary russell的帮助。我的IDE内容辅助(无法获取api函数)似乎有问题。我问了一个愚蠢的问题,在发布之前将查看消费者规范。
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();
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();