Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-2507

FileReadingMessageSource conflict between queue-size and filter

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 2.0.4, 2.1.1
    • Fix Version/s: 4.2 M2
    • Component/s: File Support
    • Labels:

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            grussell Gary Russell
            Reporter:
            morgan James Morgan
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 2d
                2d
                Remaining:
                Remaining Estimate - 2d
                2d
                Logged:
                Time Spent - Not Specified
                Not Specified