Enrich cannot use any information from the current Exchange.
It's due to how the PollingConsumer API is designed.
There is a JIRA ticket to improve this in the future.
You can use a recipient list and construct a dynamic uri with the file
name you want to poll. And you can then provide an aggregration
strategy. For example the UseLatestAggregationStrategy.
You can also just use a pojo and get the file using a producer
template or by yourself.
On Wed, Aug 4, 2010 at 1:55 PM, Andreas Asmuss <[hidden email]> wrote:
> I have a use case as this:
> 1. read an xml file
> 2. extract a file name from the xml file
> 3. poll for the extracted filename
> As I believe the easiest way to do this is with Enricher I came across the
> example in the bottom of http://camel.apache.org/content-enricher.html.
> The red box says:
> "For example you cannot set a filename in the Exchange.FILE_NAME header and
> use pollEnrich to consume only that file. For that you must set the filename
> in the endpoint URI."
> But the sample tries exactly that?
> .setHeader(Exchange.FILE_NAME, header("orderId"))
> View this message in context: http://camel.465427.n5.nabble.com/Error-in-wiki-about-pollEnrich-tp2263967p2263967.html > Sent from the Camel - Users mailing list archive at Nabble.com.
On Wed, Aug 4, 2010 at 2:42 PM, Claus Ibsen <[hidden email]> wrote:
> On Wed, Aug 4, 2010 at 2:39 PM, Andreas Asmuss <[hidden email]> wrote:
>> Ah ok.
>> What are the samples in the wiki supposed to demonstrate then?
> There is still a lot you can enrich so the wiki examples are fine.
Ah the bottom examples was wrong. I have fixed them.
They will work when we make it possible for PollingConsumer to access
data from current Exchange.