0
我必須將文件A和B順序複製到遠程文件夾。只有在A被髮送之後才發送B是重要的,至少在同一時間,而不是在之前。 我已閱讀文檔,但尚不清楚。我的想法是將2條消息放入同一個頻道。但我不知道鏈接到這兩條消息的文件是否會按順序發送。如何通過SFTP順序複製文件(彈簧集成)?
@Component
public class JobExportExecutionsRouter {
...
@Autowired
private MessageChannel sftpIncrExportChannel;
...
@Router
public List<String> routeJobExecution(JobExecution jobExecution) {
final List<String> routeToChannels = new ArrayList<String>();
...
sftpIncrExportChannel.send(MessageBuilder.withPayload(fileA).build());
sftpIncrExportChannel.send(MessageBuilder.withPayload(fileB).build());
routeToChannels.add("sftpIncrExportChannel");
return routeToChannels;
}
}
我的XML配置包含:
<int:channel id="sftpIncrExportChannel">
<int:queue/>
</int:channel>
...
<int-sftp:outbound-channel-adapter session-factory="sftpSessionFactory" channel="sftpIncrExportChannel" charset="UTF8" remote-directory="${export.incr.sftp.dir}" />
...
<bean id="sftpSessionFactory"
class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory">
<property name="host" value="${export.incr.sftp.dir}"/>
<property name="user" value="${export.incr.sftp.user}"/>
<property name="password" value="${export.incr.sftp.password}"/>
</bean>
你有什麼建議?
好。我會試試這個。謝謝 – salidou