FAQ
Hi, We have route as below. The files from data/temp need to be send to smtp
server every 5 mins. But this is not happening here. Is anything missed in
the route here? I have read few threads related to this but no luck.

from("quartz://myTimer?trigger.repeatInterval=300000&trigger.repeatCount=-1").
from("file:data/temp?noop=true").
when(header("CamelFileName").isEqualTo("template1.html")).
setHeader("Message-ID",constant("<SEMA-CR-"+rand.nextLong()+"@yy>")).
to("smtp://localhost:9819?to="myEmailID").
bean(FileValidator.class, "processFiles").

when(header("CamelFileName").isEqualTo("template2.html")).
setHeader("Message-ID",constant("<SEMA-CR-"+rand.nextLong()+"@yy>")).
to("smtp://localhost:9819?to="myEmailID").
bean(FileValidator.class, "processFiles");

Thanks in advance.

--
View this message in context: http://camel.465427.n5.nabble.com/Consuming-Files-using-Timer-Quartz-tp3320330p3320330.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Search Discussions

  • Christian Müller at Dec 28, 2010 at 5:21 pm
    from("xxx").from("yyy") is not valid.

    See the configuration options for the camel-file [1] if the directory should
    be polled for every 5 minutes. Look for the the "delay" option and maybe
    also the "initialDelay" option.

    If you want to send the same file every 5 minutes (for whatever reason), use
    the camel-quartz [2] component to trigger a processor which use a consumer
    template to consume the file. See the Camel in Action book [3] for details
    (site 481 chapter C.2.1).
    This is not an elegant way and will be improved in Camel 3 [4] (look for
    schedule DSL)

    [1] http://camel.apache.org/file2.html
    [2] http://camel.apache.org/quartz.html
    [3] http://www.manning.com/ibsen/
    [4] https://cwiki.apache.org/confluence/display/CAMEL/Camel+3.0+-+Roadmap

    Cheers,
    Christian
  • Kanmisc at Jan 7, 2011 at 12:47 pm
    Thanks Christian. It worked well with Consumer and Producer Templates.
    --
    View this message in context: http://camel.465427.n5.nabble.com/Consuming-Files-using-Timer-Quartz-tp3320330p3331784.html
    Sent from the Camel - Users mailing list archive at Nabble.com.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriescamel
postedDec 28, '10 at 2:56p
activeJan 7, '11 at 12:47p
posts3
users2
websitecamel.apache.org

2 users in discussion

Kanmisc: 2 posts Christian Müller: 1 post

People

Translate

site design / logo © 2022 Grokbase