Ibrahim
Ibrahim

Reputation: 1471

Camel Spring boot application.properties doesn't support dynamic values

I'm using camel in spring boot. I want to save file in dynamic name. Example using current timestamp for file name like "Prefix-20170612115230.xml". I can do that if I hard code it like from(FTP).marshal().to("file:tmp/outbound?fileName=Prefix-${date:now:yyyyMMddHHmmss}.xml").

But if I add this value to application.properties as outbound.ftp.location=file:tmp/outbound?fileName=CA-RP-na-${date:now:yyyyMMddHHmmss}.xml and using this value in route as from(FTP).marshal().to("{{outbound.ftp.location}}"), then the file name is something like Prefix-now:yyyyMMddHHmmss.xml.

What is the right way to use application.properties for this. I guess I need to escape $ sign but escaping it like #{'$'} didn't help.

Upvotes: 1

Views: 748

Answers (1)

Claus Ibsen
Claus Ibsen

Reputation: 55710

Use $simple{date:now:yyyyMMddHHmmss}, see the alternative syntax information bot at: http://camel.apache.org/simple.html

Upvotes: 1

Related Questions