Dynamically creating camel file routes

14 views Asked by At

I am trying to achive the following:

  • Reading a jpa-repostory periodically (eg. once a day)
    • The repository contains data which allows me to construct a source-pathname of a directory to be polled
    • The files read from the directory shall be copied to a destination directory

Basically, it is a nested loop that starts with jpa:

from("jpa:..." +
     "<Entity>" +
     "?entityManagerFactory=..." +
     "&delay=1d" +
     "&namedQuery=process-config")
...

Next step would be to create a directory-route from variables

fromF("file:%s" +
      "?charset=%s" +
      "&delete=true", c.getSourcePath(),c.getIso())
  .log(LoggingLevel.INFO, "Load: {${file:absolute.path}}")
  .toF("file:%s",c.targetPath())

I dont get it, how to construct & reconstruct the file routes dynamically

0

There are 0 answers