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.

Reply via email to