Search code examples
javaapache-camelfuseesb

Apache Camel-2.22.1 Unable to evaluate dynamic date expression in output directory


I am trying to send file to an output location to a directory with todate as suffix as given in the format file:D:/out-${date:now:yyyyMMdd}.

But I am getting exception.

java.nio.file.InvalidPathException: Illegal char <:>

Is there something I am doing wrong?


Solution

  • Try using Recipient List (http://camel.apache.org/recipient-list.html) to dynamically build the to uri. If you are using DSL to build your route, it would look something like this:

    from("file://C:/in")
        .recipientList(simple("file:D:/out-${date:now:yyyyMMdd}"));