Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-7688

AttachmentDeserializer does not respect "org.apache.cxf.io.CachedOutputStream.Threshold" -property

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.1.14, 3.2.3
    • 3.1.16, 3.2.5
    • Core
    • None
    • Novice

    Description

      Problem:
      Setting the system property "org.apache.cxf.io.CachedOutputStream.Threshold" to raise the threshold size of writing a temporary file to disk, does not affect AttachmentDeserializer.

      AttachmentDeserializer will call AttachmentUtil.setStreamedAttachmentProperties(Message, CachedOutputStream), effectively setting the temp-file threshold to AttachmentDeserializer.THRESHOLD (100k).

      Solution:
      AttachmentDeserializer should read the system property and set its value to the message context with the key AttachmentDeserializer.ATTACHMENT_MEMORY_THRESHOLD, before calling AttachmentUtil.setStreamedAttachmentProperties(...).

      Workaround:
      Register a custom interceptor, which will write the above mentioned system property to the message context. The interceptor must be registered to a Phase that will be called before JAXBAttachmentSchemaValidationHack is called.

      Attachments

        Activity

          People

            coheigea Colm O hEigeartaigh
            jiramies Lari Pannila
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: