Kraagenskul
Kraagenskul

Reputation: 464

Is there a way to setup a timed or polling route in Apache Camel only using the Spring DSL?

I have a nice simple route that uses Camel's ftpcomponent:

<camelContext id="myroute" xmlns="http://camel.apache.org/schema/spring">
    <route>
        <from uri="file:///outgoing"/>
        <to uri="ftp://user@randomftpsite/test/?password=password"/>
    </route>
</camelContext>

Is there a way to have this route triggered, say once an hour, right in the Spring DSL?

Upvotes: 0

Views: 287

Answers (1)

hveiga
hveiga

Reputation: 6925

Yes.

<camelContext id="myContext" xmlns="http://camel.apache.org/schema/spring">
    <route id="myRoute">
        <from uri="file:///outgoing?delay=1h"/> 
        <to uri="ftp://user@randomftpsite/test/?password=password"/>
    </route>
</camelContext>

File can do that directly. You should take a look here: http://camel.apache.org/file2.html

Upvotes: 2

Related Questions