INT-4095: Support Limiting (S)FTP Files Fetched

JIRA: https://jira.spring.io/browse/INT-4095

Limit the number of remote files fetched on each poll (when it is necessary to fetch files).

Polishing - PR Comments

Polishing - Decouple MaxFetchSize from Poller

Polishing - PR Comments

Schemas and Docs

More Polishing

* Polishing according PR comments
This commit is contained in:
Gary Russell
2016-08-18 18:15:04 -04:00
committed by Artem Bilan
parent 53237aa833
commit ea4763faa9
25 changed files with 534 additions and 33 deletions

View File

@@ -42,6 +42,7 @@
temporary-file-suffix=".bar"
comparator="comparator"
local-filter="acceptAllFilter"
max-fetch-size="42"
delete-remote-files="${delete.remote.files}"
preserve-timestamp="true">
<poller fixed-rate="1000">

View File

@@ -102,6 +102,7 @@ public class InboundChannelAdapterParserTests {
Collection<FileListFilter<?>> filters =
TestUtils.getPropertyValue(source, "fileSource.scanner.filter.fileFilters", Collection.class);
assertThat(filters, hasItem(acceptAllFilter));
assertEquals(42, source.getMaxFetchSize());
context.close();
}
@@ -117,6 +118,7 @@ public class InboundChannelAdapterParserTests {
.getPropertyValue(autoChannelAdapter, "source.synchronizer.remoteDirectoryExpression", Expression.class)
.getExpressionString());
assertSame(autoChannel, TestUtils.getPropertyValue(autoChannelAdapter, "outputChannel"));
assertEquals(Integer.MIN_VALUE, TestUtils.getPropertyValue(autoChannelAdapter, "source.maxFetchSize"));
context.close();
}

View File

@@ -137,7 +137,7 @@ public class SftpInboundRemoteFileSystemSynchronizerTests {
assertNull(nothing);
// two times because on the third receive (above) the internal queue will be empty, so it will attempt
verify(synchronizer, times(2)).synchronizeToLocalDirectory(localDirectory);
verify(synchronizer, times(2)).synchronizeToLocalDirectory(localDirectory, Integer.MIN_VALUE);
assertTrue(new File("test/a.test").exists());
assertTrue(new File("test/b.test").exists());