If you just want to read a file in pollEnrich then you can transform the message to a java.io.File and specify the file name dynamically using the simple/file language.
<split> ... <transform> <simple resultType="java.io.File">file:{{inbound_home}}/pgsl/${body.FileDir}</simple> </transform> </split> On Sun, Jul 28, 2013 at 3:17 PM, skumar <sku...@stonewain.com> wrote: > Hi All, > I am a camel newbie and searching for more than 3 days but couldn't > get an appropiate answer. > Actually I have to process lot of files one by one using the same route > based on some criteria.I get the criteria value and the uri of the file from > the database,spitted it using a splitter and then tried to aggregate the > existing content(in the message header) with the new content which i will > receive from the file://uri. > Seems pollEnrichment couldn't work because it doesn't support dynamic uri.I > am fetching the file path from .properties file and database.So I am stuck > here how to achieve both combining the content and use dynamic uri for file > processing.Note I dont want to use,java.io.file to read the file.Can we use > a consumer template for this but I am anxious how to combine the content > from old and new exchanges.Here is part of my code: > <from uri="timer://foo?fixedRate=true&period=5000"/> > <to uri="bean:locatesSql?method=getFileFormatDetails" /> > <split> > <choice><when><simple>${body.streamName} == > 'GenericSupplyBeanIO'</simple> > <pollEnrich > uri="file:{{inbound_home}}/pgsl?fileName="here I > want a dynamic uri content in body.FileDir" /> > I am stuck and will highly appreciate any help. > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/combining-the-existing-content-with-a-file-having-dynamic-uri-then-moving-the-file-tp5736365.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: cib...@redhat.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen