0
두 개의 개별 디렉토리에서 하나의 로컬 폴더로 sftp를 통해 파일을로드하려고합니다. 그래서 나는이 같은 두 개의 인바운드 채널 어댑터가 : Sftp 인바운드 채널 어댑터 : 중복 메시지
<bean id="lastModifiedFileFilter" class="com.test.sftp.SftpLastModifiedFileListFilter">
<constructor-arg name="age" value="100"/>
</bean>
<int:poller id="fixedRatePoller" fixed-rate="100"
time-unit="SECONDS"/>
<int-sftp:inbound-channel-adapter id="inbound1"
session-factory="sftpSessionFactory"
auto-create-local-directory="true"
delete-remote-files="true"
remote-directory="/remote-folder1"
filter="lastModifiedFileFilter"
local-directory="/local-folder"
channel="nullChannel">
<int:poller ref="fixedRatePoller"/>
</int-sftp:inbound-channel-adapter>
<int-sftp:inbound-channel-adapter id="inbound2"
session-factory="sftpSessionFactory"
auto-create-local-directory="true"
delete-remote-files="true"
remote-directory="/remote-folder2"
filter="lastModifiedFileFilter"
local-directory="/local-folder"
channel="nullChannel">
<int:poller ref="fixedRatePoller"/>
</int-sftp:inbound-channel-adapter>
그리고 예를 들어
경우 "원격 폴더 1"나는 로그에 다음과 같은 메시지가에가 "test.csv"라는 새로운 파일을 을INFO Created message: [GenericMessage [payload=local-folder/test.csv, headers={id=bb76252a-e826-579d-b0e1-cab55a7cc957, timestamp=1508242673896}]] [task-scheduler-6][FileReadingMessageSource]
INFO Created message: [GenericMessage [payload=local-folder/test.csv, headers={id=a76de653-f805-8add-1e02-924d0915a18c, timestamp=1508242673962}]] [task-scheduler-2][FileReadingMessageSource]
이상하게 보입니다. 이유는 하나의 파일 당 두 개의 메시지가 있습니다. 어쩌면 내가 잘못된 구성을 가지고 있을까요? 어떤 사람들은이 행동을 설명 할 수 있습니까?
설명해 주셔서 감사합니다. 내가 원했던 것은 sftp를 통해 원격 서버에서 로컬 디렉토리로 재귀 적으로 파일을 복사하는 것입니다 (하위 디렉토리 포함). 더 이상 처리하지 않고 복사하십시오. 스프링 통합으로 해결할 솔루션이 있습니까? 나는 그 점에 관해서 문서에서 아무것도 발견하지 못했다. 나에게 조언 해 줄 수 있니? –
정말요? 어떻게'MGET' : https://docs.spring.io/spring-integration/docs/4.3.12.RELEASE/reference/html/sftp.html#sftp-outbound-gateway? –