camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebinsingh <ebenezer.si...@VerizonWireless.com>
Subject Re: Type Converters Load
Date Fri, 11 Nov 2011 12:52:04 GMT
I am using a Timer.
Sorry as a begnier, please let me know what would be the best way to start
the route and it should keep running all day long. 
This is to read and process any file that comes into the directory.


    private final Timer timer = new Timer();

    public void start() {
        timer.schedule(new TimerTask(){
            public void run() {
            	try{
	    	        JmsComponent comp = (JmsComponent)sprContext.getBean("wmq");
	    	        context.addComponent("jms",
JmsComponent.jmsComponentAutoAcknowledge(comp.getConfiguration().getConnectionFactory()));
	    	        //context.addRoutes(new SedaRouteBuilder(routingProps));
	    	        context.addRoutes(new CamelTimeAnalyzer());
	    	        //context.addRoutes(new AggregateAndProcess());
	    	        context.start();
            	}catch(Exception ex){
            		log.error("Error while parsing", ex);
            		timer.cancel();
            	}
            }
        }, 2000);
    }

    public static void main(String[] args) {
    	StartCamelTimeAnalyser startCamelTimeAnalyser = new
StartCamelTimeAnalyser();
    	startCamelTimeAnalyser.start();
    }


--
View this message in context: http://camel.465427.n5.nabble.com/Type-Converters-Load-tp4982080p4984258.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message