0

I've got a question regarding the streaming of large files using WSO2 ESB and the VFS transport. I have set up a proxy reading a file from an FTP location. This file should be streamed through WSO2 and be written to a targert location. In order to activate streaming, I have set the transport.vfs.Streaming parameter to "true" on the sender side and I have declared a corresponding property on the receiver side.

<proxy xmlns="http://ws.apache.org/ns/synapse" name="LargeFileTestProxy" transports="vfs" startOnLoad="true" trace="disable">
<target>
    <inSequence>
        <property xmlns:ns2="http://org.apache.synapse/xsd" name="transport.vfs.ReplyFileName" expression="fn:concat(fn:substring-after(get-property('MessageID'), 'urn:uuid:'), '.xml')" scope="transport" type="STRING"/>
        <property name="transport.vfs.Streaming" value="true" scope="transport" type="STRING"/>
        <property name="transport.vfs.Append" value="true" scope="transport" type="STRING"/>
        <property name="OUT_ONLY" value="true" scope="default" type="STRING"/>
        <send>
            <endpoint>
                <address uri="vfs:file:///poc/services/inbound"/>
            </endpoint>
        </send>
    </inSequence>
    <outSequence/>
    <faultSequence/>
</target>
<parameter name="transport.vfs.Streaming">true</parameter>
<parameter name="transport.PollInterval">1</parameter>
<parameter name="transport.vfs.FileURI">vfs:ftp://admin:admin@localhost</parameter>
<parameter name="transport.vfs.FileNamePattern">.*\.xml</parameter>
<parameter name="transport.vfs.ContentType">application/xml</parameter>

The transmitted file is partly written to the destination directory and a lock file is generated by WSO2. Unfortunately the rest of the read file isn't appended to the file.

Does anybody know what's wrong with my configuration?

Kind regards,

Heiko

Heiko
  • 53
  • 5

1 Answers1

0

You need to set transport.vfs.Append=true parameter with file address URI, in order to append to the output file [1].

<address uri="vfs:file:///poc/services/inbound?transport.vfs.Append=true"/>

It doesn't work when you configure it as a VFS property.

[1]http://docs.wso2.org/display/ESB450/VFS+Transport

  • 1
    Thank's for the reply. I have adjusted the address endpoint URI as suggested. Now the file is written to the directory services having the name "inbound?transport.vfs.Append=true". It doesn't seem that the URI is evaluated by WSO2/VFS as expected... – Heiko Oct 24 '13 at 08:02
  • Hi @Lakmali Erandi Baminiwatta, how can we upload attachment via wso2 EI API? – Justin Oct 15 '20 at 08:04