Announcement Announcement Module
Collapse
No announcement yet.
Is there a reason why FileTransferringMessageHandler is not using BufferedInputStream Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is there a reason why FileTransferringMessageHandler is not using BufferedInputStream

    Hi I've been exploring the code source in order to know if it was interesting to add custom code to enable java.nio.file.Path in a
    Code:
    MessageBuilder.withPayload(...).build()
    , and I came across the class
    Code:
    FileTransferringMessageHandler
    .

    Looking at the code I was a surprised that the code don't use BufferedInputStream to read the file that will be transferred. That is quite suboptimalto transfer huge files. Plus it stresses the system / hardware.

    At line 242 of
    Code:
    org.springframework.integration.file.remote.handler.FileTransferringMessageHandler#sendFileToRemoteDirectory
    in Spring integration 2.2.0

    And I've seen the same thing in other handlers of spring-integration-file, and in the current code of spring integration 3 on github.
    Is there a reason for not using BufferedInputStream or maybe even BufferedOutputStream ?


    Cheers,
    Brice

  • #2
    You raise a good point. Please open an 'Improvement' JIRA issue...

    https://jira.springsource.org/browse/INT

    We would encourage you to make a contribution, please see: https://github.com/SpringSource/spri...ONTRIBUTING.md

    Comment


    • #3
      Done there : https://jira.springsource.org/browse/INT-2953
      I'll see about the contribution later; I'm not sure how I can prove in a test that the code uses a BufferedInputStream however.

      Comment

      Working...
      X