Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-158

Stream body in JDBCMailRepository.store(Mail)

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1, 2.2.0
    • Fix Version/s: 2.3.0
    • Labels:
      None

      Description

      JDBCMailRepository.store(Mail) writes the entire message into a ByteArrayOutputStream when not using dbfile protocol. This is "A Bad Thing", and should be changed so that the body is streamed direcly.

        Activity

        Hide
        bago Stefano Bagnara added a comment -

        This should be fixed.
        Changed the default behaviour to use bytearrays only with messages smaller than 4K and pipedinputstream/pipedoutputstream + worker thread for larger message.
        Created a MessageInputStream object that automatically handle this behaviour.

        Further tests are needed to check correctness of error handling (exceptions cought in the worker threads are stored in the main object that should throw them to the main thread) and to be sure resources are correctly freed.

        Show
        bago Stefano Bagnara added a comment - This should be fixed. Changed the default behaviour to use bytearrays only with messages smaller than 4K and pipedinputstream/pipedoutputstream + worker thread for larger message. Created a MessageInputStream object that automatically handle this behaviour. Further tests are needed to check correctness of error handling (exceptions cought in the worker threads are stored in the main object that should throw them to the main thread) and to be sure resources are correctly freed.
        Hide
        danny@apache.org Danny Angus added a comment -

        Closing issue fixed in released version.

        Show
        danny@apache.org Danny Angus added a comment - Closing issue fixed in released version.

          People

          • Assignee:
            bago Stefano Bagnara
            Reporter:
            noel Noel J. Bergman
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development