Good morning,

i ve got a problem with the timer of camel 2.0-M3.
It doesn't run ...The java code and the route seem to be ok...(see code ko)
if i configure a route with quartz and an cron expression,it works.....(see
code ok)
 
Does someone have an idea?


CODE KO

RouteBuilder builder = new RouteBuilder() {
public void configure() {
from("timer://foo?fixedRate=true&period=3000").process(new Processor() {
                                        public void process(Exchange e) {
                                                logger.info("Test 1 ");
                                        }
                                });
                        };};
CamelContext myCamelContext = new DefaultCamelContext();
                        try {
                                myCamelContext.addRoutes(builder);
                                myCamelContext.start();

                        } catch (Exception e) {
                                e.printStackTrace();
                                myCamelContext=null;
                                builder=null;
                        }
                        finally{

                        }
CODE OK

RouteBuilder builder = new RouteBuilder() {
public void configure() {

                                
from("quartz://start/TimerTaskForArchivingRecapList/?cron=0+*/2+*+*+*+?")
                                        .process(new Processor() {
                                        public void process(Exchange e) {
                                                logger.info("Test 2");
                                        }
                                });
                        };};
                        CamelContext myCamelContext = new DefaultCamelContext();
                        try {
                                myCamelContext.addRoutes(builder);
                                myCamelContext.start();

                        } catch (Exception e) {
                                e.printStackTrace();
                                myCamelContext=null;
                                builder=null;
                        }
                        finally{

                        }
-- 
View this message in context: 
http://www.nabble.com/Problem-with-the-timer-of-camel-2.0-M3-------tp25363752p25363752.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to