I have a CSV File that I am reading via VFS. After reading the file, I am using Smooks to convert the CSV data into XML and then sending it to another proxy. By default configuration, smooks converts the whole message into one xml payload.
Problem:
The default method is okay for small files, but I have a very large file to process and I want that I can read the file line by line and then send the message to the next component.
Proxy Configuration:
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="ParseTestCSV1"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="vfs">
<target>
<inSequence>
<log level="full" separator="*********Parsing Prroxy Started*****"/>
<smooks config-key="gov:/repository/csv/smooks-config.xml">
<input type="text"/>
<output type="xml"/>
</smooks>
<log level="full" separator="********After Smooks*******"/>
<property name="OUT_ONLY" value="true"/>
<property action="remove" name="ClientApiNonBlocking" scope="axis2"/>
<call/>
<log level="full" separator="*******Message Sent*********"/>
</inSequence>
<outSequence/>
<faultSequence/>
</target>
<parameter name="transport.PollInterval">60</parameter>
<parameter name="transport.vfs.FileURI">vfs:file://C:\WSO2EnterpriseIntegrator\file\In</parameter>
<parameter name="transport.vfs.ContentType">text/plain</parameter>
<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
<parameter name="transport.vfs.MoveAfterFailure">vfs:file://C:\WSO2EnterpriseIntegrator\file\Fail</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
<parameter name="transport.vfs.FileNamePattern">convert.*.csv</parameter>
<parameter name="transport.vfs.MoveAfterProcess">vfs:file://C:\WSO2EnterpriseIntegrator\file\Out</parameter>
<description/>
</proxy>
Smooks Configuration File:
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd" xmlns:csv="http://www.milyn.org/xsd/smooks/csv-1.2.xsd">
<resource-config selector="org.xml.sax.driver">
<resource>org.milyn.csv.CSVReader</resource>
<param name="fields">$ignore$,firstname,lastname,age,street,address,statecode,postalcode,amount,code,date</param>
<param name="rootElementName">record</param>
<param name="recordElementName">csvRecord</param>
</resource-config>
</smooks-resource-list>
How can I transform my Smook's configuration file to read one line and then send it forward. Any insight would be appreciated.