I have a route with files (filename_YYYYMMDD.txt) as input endpoint i.e.

   from("file://folder/filename_*.txt")
      .transacted()
      .id("MyRoute")
      .process(new MyProcessor);

I want to trigger this route from a restful where the date part of the file
is specified in input i.e.

   template.sendBodyAndHeaders("direct:myRoute", null, "header:date",
"20170508")

so I've thought I could modify my route so that the input endpoint is
dynamic by using pollEnrich i.e.

   from("direct:myRoute")
      .transacted()
      .id("MyRoute")
      .pollEnrich().simple("file://folder/filename_${header:date}.txt")
      .process(new MyProcessor());

But nothing happens :(

If I had a timeout to pollEnrich then it waits for the milliseconds I
specified and then it runs MyProcessor regardless of the fact that the file
exists or not.

What am I doing wrong?
Thank you!



--
View this message in context: 
http://camel.465427.n5.nabble.com/Dynamic-from-and-pollEnrich-tp5799032.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to