Hi

I have a setup where I start a route with with a quartz timer. This route
then starts another route that does the actual work of fetching files from
an ftp and then shuts down.

The problem with this workaround is that the ftp-fetching route will never
shut down if there are no messages on the ftp since it is a message reaching
the end of the route that activates the shut down.

Any ideas how to fix this? :)

<!-- Scheduled start-FTP trigger route -->
<route id="StartFtpTriggerRoute" autoStartup="true">
        <from uri="quartz://scheduledpoll?cron={{cron.poll}}" />
        <setHeader headerName="routeToStart">
                <constant>FtpPollingRoute</constant>
        </setHeader>
        <bean ref="RouteController" method="start" />    
        <stop />
</route>

<!-- Route-stopping route -->
<route>
        <from uri="seda:StopRouteRoute" />
        <bean ref="RouteController" method="stop" />
</route>

<!-- FTP polling route -->
<route id="FtpPollingRoute" errorHandlerRef="deadLetterErrorHandler"
autoStartup="false">
        <from
uri="ftp:{{ftp.server}}{{ftp.inbox}}?username={{ftp.user}}&amp;password={{ftp.password}}&amp;delete=true&amp;disconnect=true"
/>
        <onCompletion>
                <filter>
                        <simple>${property.CamelBatchComplete} == true</simple>
                        <setHeader headerName="routeToStop">
                                <constant>FtpPollingRoute</constant>
                        </setHeader>
                        <to uri="seda:StopRouteRoute" />
                </filter>
        </onCompletion>
        <to uri="file:data" />
</route>


-- 
View this message in context: 
http://old.nabble.com/Route-does-not-shut-down-if-there-is-no-message-on-poll.-tp28815309p28815309.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to