You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Flatpack Component

The Flatpack component supports fixed width and delimited file parsing via the FlatPack library.

URI format

flatpack:[delim|fixed]:flatPackConfig.pzmap.xml

or for a delimited file handler with no configuration file just use

flatpack:someName

Examples

  • flatpack:fixed:foo.pzmap.xml creates a fixed width endpoint using the foo.pzmap.xml file configuration
  • flatpack:delim:bar.pzmap.xml creates a delimited endpoint using the bar.pzmap.xml file configuration
  • flatpack:foo creates a delimited endpoint called foo with no file configuration

URI Options

Name

Default Value

Description

delimiter

','

the default character delimiter for delimited files

textQualifier

'"'

the text qualifier delimited files

ignoreFirstRecord

true

whether the first line is ignored for delimited files (for the column headers)

Using the endpoint

A common use case is sending a file to this endpoint for further processing in a separate route. For example...

  <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
    <route>
      <from uri="file://someDirectory"/>
      <to uri="flatpack:foo"/>
    </route>

    <route>
      <from uri="flatpack:foo"/>
      ...
    </route>
  </camelContext>

You can also convert the payload of each message created to a Map for easy Bean Integration

  • No labels