Axiom: Get the content length for a streaming inbound message
-------------------------------------------------------------
Key: WSCOMMONS-330
URL: https://issues.apache.org/jira/browse/WSCOMMONS-330
Project: WS-Commons
Issue Type: Improvement
Components: AXIOM
Reporter: Rich Scheuerle
Assignee: Rich Scheuerle
Background:
I have a user that wants to log the length of the inbound message.
Unfortunately this information is not available if the inbound message is
chunked.
Solution:
I am designing a new "input stream filter" to Axiom called
DetachableInputStream.
The DetachableInputStream has two new methods:
a) length() which returns the accumulated length of the stream.
b) detach() which consumes and buffers the original input stream (detaching
from the original input stream allows its resources to be freed/reused).
The Attachments object will wrap the incoming stream with a
DetachableInputStream. Users can query the Attachments object to get the
content length.
This is a simple solution that can be useful in other situations.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.