Hi

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 <[email protected]> wrote:
>
> Hi
>
> 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?
> from("activemq:queue:order")
>   .setHeader(Exchange.FILE_NAME, header("orderId"))
>   .pollEnrich("file://order/data/additional")
>   .to("bean:processOrder");
> --
> 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.
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to