axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Veithen <>
Subject Re: Introducing a new feature to enable MTOM attachment streaming
Date Mon, 25 Jul 2011 18:16:38 GMT
On Mon, Jul 25, 2011 at 08:16, Sadeep Jayasumana <> wrote:
> Hi Devs,
> In Apache Syanpse, we have a requirement to proxy an MTOM enabled web
> service with minimum overhead. Large files (even in GB range) should be able
> to go through Synapse without running it OOM.
> To satisfy this requirement, Synapse should be able to forward an incoming
> SOAP message with MTOM attachments to the backend service without building
> the attachments. Synapse might read/modify the SOAP envelop but not the
> attachments. Therefore, it should be possible to stream attachments directly
> from the Synpase's client to the backend service.
> However, in the current implementation of AXIOM and Axis2, MTOM attachments
> are built (in memory or in a file) by SOAPMessageFormatter. This caused
> Synapse to run OOM when in the above mentioned scenario.
> I have come up with a fix for this. It is to introduce a
> new org.apache.axiom.attachments.impl.AbstractPart implementation which
> streams non-soap MIME parts without building them.
> To introduce this new feature without breaking existing stuff, I'm planning
> to introduce a new message context property which enables MTOM streaming.
> org.apache.axis2.builder.BuilderUtils class will check this property in the
> message context and create org.apache.axiom.attachments.Attachments
> object accordingly. Does this sound like the correct way of introducing this
> feature?

The Attachments object is one of the first things that will be created
when a new message is received. Therefore nobody will be able to set a
property in the message context, i.e. the setting would necessarily be
a global property in axis2.xml. This however is a problem if you have
services with diverging requirements. The decision to buffer or not
the content of the MIME part can't be taken at this stage in the
processing. It can only be taken when the MIME part is actually
accessed (which includes serializing the message to forward it).

> Appreciate your feedback.
> Thanks,
> --
> Sadeep Jayasumana
> Software Engineer,
> WSO2 Inc.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message