Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to read huge CSV file in Mule
    primarykey
    data
    text
    <p>I'am using Mule Studio 3.4.0 Community Edition. I have a big problem about how to parse a large CSV file incoming with File Endpoint. The scenario is that I have 3 CSV files and I would putting the files'content into a database. But when I try to load a huge file (about 144MB) I get the "OutOfMemory" Exception. I thought as solution to divide/split my the large CSV into smaller size CSVs (I don't know if this solution is the best) o try to find a way to process CSV without throwing an exception. </p> <pre><code>&lt;file:connector name="File" autoDelete="true" streaming="true" validateConnections="true" doc:name="File"/&gt; &lt;flow name="CsvToFile" doc:name="CsvToFile"&gt; &lt;file:inbound-endpoint path="src/main/resources/inbox" moveToDirectory="src/main/resources/processed" responseTimeout="10000" doc:name="CSV" connector-ref="File"&gt; &lt;file:filename-wildcard-filter pattern="*.csv" caseSensitive="true"/&gt; &lt;/file:inbound-endpoint&gt; &lt;component class="it.aizoon.grpBuyer.AddMessageProperty" doc:name="Add Message Property"/&gt; &lt;choice doc:name="Choice"&gt; &lt;when expression="INVOCATION:nome_file=azienda" evaluator="header"&gt; &lt;jdbc-ee:csv-to-maps-transformer delimiter="," mappingFile="src/main/resources/companies-csv-format.xml" ignoreFirstRecord="true" doc:name="CSV2Azienda"/&gt; &lt;jdbc-ee:outbound-endpoint exchange-pattern="one-way" queryKey="InsertAziende" queryTimeout="-1" connector-ref="jdbcConnector" doc:name="Database Azienda"&gt; &lt;jdbc-ee:query key="InsertAziende" value="INSERT INTO aw006_azienda VALUES (#[map-payload:AW006_ID], #[map-payload:AW006_ID_CLIENTE], #[map-payload:AW006_RAGIONE_SOCIALE])"/&gt; &lt;/jdbc-ee:outbound-endpoint&gt; &lt;/when&gt; &lt;when expression="INVOCATION:nome_file=servizi" evaluator="header"&gt; &lt;jdbc-ee:csv-to-maps-transformer delimiter="," mappingFile="src/main/resources/services-csv-format.xml" ignoreFirstRecord="true" doc:name="CSV2Servizi"/&gt; &lt;jdbc-ee:outbound-endpoint exchange-pattern="one-way" queryKey="InsertServizi" queryTimeout="-1" connector-ref="jdbcConnector" doc:name="Database Servizi"&gt; &lt;jdbc-ee:query key="InsertServizi" value="INSERT INTO ctrl_aemd_unb_servizi VALUES (#[map-payload:CTRL_ID_TIPO_OPERAZIONE], #[map-payload:CTRL_DESCRIZIONE], #[map-payload:CTRL_COD_SERVIZIO])"/&gt; &lt;/jdbc-ee:outbound-endpoint&gt; &lt;/when&gt; &lt;when expression="INVOCATION:nome_file=richiesta" evaluator="header"&gt; &lt;jdbc-ee:csv-to-maps-transformer delimiter="," mappingFile="src/main/resources/requests-csv-format.xml" ignoreFirstRecord="true" doc:name="CSV2Richiesta"/&gt; &lt;jdbc-ee:outbound-endpoint exchange-pattern="one-way" queryKey="InsertRichieste" queryTimeout="-1" connector-ref="jdbcConnector" doc:name="Database Richiesta"&gt; &lt;jdbc-ee:query key="InsertRichieste" value="INSERT INTO ctrl_aemd_unb_richiesta VALUES (#[map-payload:CTRL_ID_CONTROLLER], #[map-payload:CTRL_NUM_RICH_VENDITORE], #[map-payload:CTRL_VENDITORE], #[map-payload:CTRL_CANALE_VENDITORE], #[map-payload:CTRL_CODICE_SERVIZIO], #[map-payload:CTRL_STATO_AVANZ_SERVIZIO], #[map-payload:CTRL_DATA_INSERIMENTO])"/&gt; &lt;/jdbc-ee:outbound-endpoint&gt; &lt;/when&gt; &lt;/choice&gt; &lt;/flow&gt; </code></pre> <p>Please, I do not know how to fix this problem. Thanks in advance for any kind of help</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload