The following example script is used for illustrative purposes. In two places
the VFS payload is copied. Into a property, and in the JSScript. In full
scenario the property value is used later in a chain of Web service but
needs to be stored temporily, as the request will be replaced by
request/responce of next web service. The file drop will be replaced by FTP.
Issue is we get 'big' files by FTP that we need to submit to a Web Service.
The Web Service is OK with the large data, but will Synapse cope.
Issues:
1) What if the payload gets large;
What is large (5MB, 20 MB ?) and
What problems will this mean for this code e.g. Memory etc.
2) The JSScript could be replaced with a Java Mediator and use a
stream to better copy the VFS text element {data}. However still means
it would
copy whole string into memory.
3) Storing the payload temporarily, e.g. alternative to property. How big
can Property be ?
4) using the XPath to get the payload into property.
<definitions xmlns="http://ws.apache.org/ns/synapse">
<sequence name="insequence">
<property name="data" expression="//data"/>
<log level="full"/>
</sequence>
<proxy name="GetGuidProxy">
<target inSequence="insequence"/>
</proxy>
<sequence name="test">
<log level="full"/>
<script language="js"><![CDATA[
var data = mc.getPayloadXML().toString();
mc.setPayloadXML(
<data>{data}</data>);
]]></script>
<log level="full"/>
<send>
<endpoint>
<address uri="http://localhost:8280/soap/GetGuidProxy"/>
</endpoint>
</send>
</sequence>
<proxy name="FileCheckProxy" transports="vfs">
<parameter name="transport.vfs.FileURI">file:///C:/test/in</parameter>
<parameter name="transport.vfs.ContentType">text/plain</parameter>
<parameter name="transport.vfs.FileNamePattern">.*\.edi</parameter>
<parameter name="transport.PollInterval">15</parameter>
<target inSequence="test"/>
</proxy>
</definitions>
--
View this message in context:
http://www.nabble.com/Large-Payload%3A-Issues-tp22196278p22196278.html
Sent from the Synapse - User mailing list archive at Nabble.com.