csv-to-list - Work with CSV Format (DEPRECATED)

This feature is deprecated. It was used actively in IM 1.18.x and older. It is kept only for compatibility reasons.

This component is used for loading records from a CSV file. The loaded records can be resent directly to another PFX component (e.g. dsLoad) or can call an existing Camel endpoint. The attributes id and dataFormat are required. The component supports two types of input CSV format definitions:

  • CsvDataFormat (org.apache.camel.model.dataformat.CsvDataFormat) – preferred format

  • FlatpackDataFormat (org.apache.camel.model.dataformat.FlatpackDataFormat)

 

Attributes

Description

Required?

Attributes

Description

Required?

id

ID used for registering the component to CamelContext

yes

dataFormat

Name of the bean with a definition of the CSV file in CsvDataFormat or FlatpackDataFormat

yes

routeName

Camel route name



inputFilter

Definition of the input filter

no

batchSize

Size of the batch

no

completionTimeout

Timeout

no

outputUri

After the load is done, the component sends the data to this route.

no

 The csv-to-list component works in batches. The default batch size is 5000 items, so while csv-to-list is called once, outputUri is called multiple times with batches of 5000 items.

 

Example of usage of the csv-to-list with an inner dsLoad component and CSV data format:

<pfx:csv-to-list id="LoadRebateAgreements" dataFormat="rebateAgreementsCsvDataFormat" batchSize="500"> <pfx:dsLoad objectType="CX" businessKeys="name, attribute30" mapper="rebateAgreementsMapper"/> </pfx:csv-to-list> <!-- Definition of CSV structure in CSV data format --> <bean id="rebateAgreementsCsvDataFormat" class="org.apache.camel.model.dataformat.CsvDataFormat"> <property name="useMaps" value="true"/> <property name="skipHeaderRecord" value="true"/> <property name="header" ref="rebateAgreementHeader"/><!-- List of CSV columns--> </bean> <util:list id="rebateAgreementHeader"> <value>SalesOrganization</value> ... <value>ValidTo</value> </util:list>

 

Example of usage of the csv-to-list with a named Camel route and Flatpack data format:

<pfx:csv-to-list id="LoadCustomers" dataFormat="customersFlatpackFormat" outputUri="direct:processCustomers"/> <!-- Definition of CSV structure in Flatpack data format --> <bean id="customerHierarchyFlatpackFormat" class="org.apache.camel.model.dataformat.FlatpackDataFormat"> <property name="definition" value="maps/customer_hierarchy.pzmap.xml"/> <property name="delimiter" value=","/> <property name="ignoreFirstRecord" value="true"/> <property name="ignoreExtraColumns" value="true"/> </bean> -- Content of customer_hierarchy.pzmap.xml file-- <?xml version='1.0'?> <!DOCTYPE PZMAP SYSTEM "flatpack.dtd" > <PZMAP> <COLUMN name="kunnr" /> ... <COLUMN name="vtweg" /> </PZMAP>

IntegrationManager version 5.8.0