camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Type Converters Load
Date Sat, 12 Nov 2011 08:14:02 GMT
The idea is to only start Camel once. What you do is to start it
repeatedly from a timer.

See the FAQ such as
http://camel.apache.org/running-camel-standalone.html
http://camel.apache.org/running-camel-standalone-and-have-it-keep-running.html


On Fri, Nov 11, 2011 at 1:52 PM, ebinsingh
<ebenezer.singh@verizonwireless.com> wrote:
> 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.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Mime
View raw message