It should be <pollEnrich uri="file:someDirName?fileName=file2.txt" timeout="10000" ...>
And mind the timeout is in milli seconds. For the file url you need a starting directory and then specify the file name as an parameter On Wed, Nov 19, 2014 at 3:19 PM, patelp <[email protected]> wrote: > I have a directory that contains two files, file1.txt and file2.txt, and my > camel route picks file1.txt processes it line by line and uses file2 as a > resource for additional information. I am using pollEnrich to read the > second file. My camel.xml file looks as follows. > <route id="id1" errorHandlerRef="loggingErrorHandler"> > <from uri="file://file1.txt" /> > <pollEnrich uri="file://file2.txt" > strategyRef="aggregationStrategy" timeout="1000"/> > <to uri="{{someProcess}}" /> > <doTry> > <split> > <simple>${body}</simple> > > <bean ref="processData" /> > <aggregate strategyRef="listAggregationStrategy"> > <correlationExpression> > <constant>true</constant> > </correlationExpression> > <completionPredicate> > <method bean="listAggregationStrategy" > method="isComplete" /> > </completionPredicate> > <to uri="{{outboundUri}}" /> > </aggregate> > </split> > > <doFinally> > <to uri="{{processEnd}}" /> > </doFinally> > </doTry> > </route> > > What I am trying to achieve here is pick file2.txt using pollEnrich if it > exists. If the file isn't there I want to wait for 10 seconds and after 10 > seconds if the file still isn't there I want to exit out. > However, my program currently doesnt exist out even when I insert timeout. > It waits forever for the file. > > What am I doing wrong here? > > Thanks for the help! > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/PollEnrich-timeout-not-working-tp5759329.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/
