On Wed, Jun 26, 2019 at 11:49 PM Steve Huston <shus...@riverace.com> wrote: > > Is it possible to put a simple() expression in a properties string and have > Camel evaluate it at run time? > > Here's what I'm trying to do: > - Set a message header ID with a value I want to use later > - Use .toD("{{event.sink}}") > > application.properties can then have something like: > > event.sink = simple("file://.?fileName=status-${header.ID}.txt") >
toD using a string is simple language already, so just use event.sink = file://.?fileName=status-${header.ID}.txt > The goal being to have a message body written to a file whose name includes > the ID header value. > > When I try to run this I get an exception: > > Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder > 'header.ID' in value "simple("file://.?fileName=status-${header.ID}.txt")" > And you can use $simple{xxx} syntax for the fileName value > Thanks, > -Steve -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2