Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

So lets start with the route definition in EtlRoutes

Code Block

public class EtlRoutes extends SpringRouteBuilder {
    public void configure() throws Exception {

        from("file:src/data?noop=true")
            .convertBodyTo(PersonDocument.class)
            .to("jpa:org.apache.camel.example.etl.CustomerEntity");

        // the following will dump the database to files
        from("jpa:org.apache.camel.example.etl.CustomerEntity?consumeDelete=false&delay=3000&consumeLockEntity=false")
            .setHeader(Exchange.FILE_NAME, el("${in.body.userName}.xml"))
            .to("file:target/customers");
    }
}
Wiki Markup
{snippet:id=example|lang=java|url=https://github.com/apache/camel/blob/master/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/EtlRoutes.java}

The above sets up a route from the src/data directory. Notice we're using the noop mode of the File component so that the files are not moved or deleted when they are processed (so when the tool is restarted they will be processed again).

...