Specifying a queue-size for an inbound-channel-adapter (or constructing FileReadingmessageSource with an internalQueueCapacity) assigns a scanner with a filter that limits the number of records in a poll to the specified size. However, if a filter is also assigned, it overwrites the filter assigned by the constructor removing any limiting to the number of files maintained per scan.
It also appears that creating an inbound-channel-adapter with queue-size="#" and prevent-duplicates="true" would also do the same thing (namely, not limit the number of files maintained per scan).
A work-around is to create a new filter that does the same thing as HeadFilter in HeadDirectoryScanner and then assign that filter (along with the original) to a CompositeFileListFilter and omit the queue-size attribute.
Alternatively, HeadDirectoryScanner could be modified to implement DirectoryScanner AND have a DirectoryScanner field that it delegates everything to. All methods would pass through to the delegate. However, it would implement its listFiles method to use its own size filter to constrain and return the results of the call to the field's DirectoryScannner.listFiles method.
James Morgan opened INT-2507 and commented
Specifying a queue-size for an inbound-channel-adapter (or constructing FileReadingmessageSource with an internalQueueCapacity) assigns a scanner with a filter that limits the number of records in a poll to the specified size. However, if a filter is also assigned, it overwrites the filter assigned by the constructor removing any limiting to the number of files maintained per scan.
It also appears that creating an inbound-channel-adapter with queue-size="#" and prevent-duplicates="true" would also do the same thing (namely, not limit the number of files maintained per scan).
A work-around is to create a new filter that does the same thing as HeadFilter in HeadDirectoryScanner and then assign that filter (along with the original) to a CompositeFileListFilter and omit the queue-size attribute.
Alternatively, HeadDirectoryScanner could be modified to implement DirectoryScanner AND have a DirectoryScanner field that it delegates everything to. All methods would pass through to the delegate. However, it would implement its listFiles method to use its own size filter to constrain and return the results of the call to the field's DirectoryScannner.listFiles method.
Affects: 2.0.4, 2.1.1
Referenced from: pull request #1487
1 votes, 2 watchers
The text was updated successfully, but these errors were encountered: