Java apache camel的正则表达式中的头值

Java apache camel的正则表达式中的头值,java,apache-camel,Java,Apache Camel,我想从一个文件夹中读取与这样的正则表达式对应的文件 from("direct:queuealpha").process(new DateTagGenerator()).from("file:///folder1/folder2/?delete=false&include=.*(${headers.timetag}).*); 所以DateTagGenerator设置一个标头,其中包含一个我想在正则表达式中用作输入的值。我试着用simple转义{,$和},但我显然做错了什么 如何动态地为标

我想从一个文件夹中读取与这样的正则表达式对应的文件

from("direct:queuealpha").process(new DateTagGenerator()).from("file:///folder1/folder2/?delete=false&include=.*(${headers.timetag}).*);
所以DateTagGenerator设置一个标头,其中包含一个我想在正则表达式中用作输入的值。我试着用simple转义
{,$和}
,但我显然做错了什么


如何动态地为标题或正文创建一个值,然后将其用于正则表达式?

自Camel 2.16以来,您可以将内容丰富器与动态端点([doc][1])一起使用,尤其是
pollEnrich
(正如您使用的是
文件
endpont一样)


刚刚在电视上看到了一个副本,所以…我还是把答案留在这里
from("direct:queuealpha")
  .process(new DateTagGenerator())
  .pollEnrich.simple("file:/folder1/folder2/?delete=false&include=${headers.timetagExpr}")
  .process(…) // you can now process the message
  .to(…); // and send it onward