Hello,

I have a project in which I get two rss-files. I split them and I need to
add some more information to every splitted messages. This information I
need only once and after that the specific route should be closed. For
example:

//get rss-file
from("rss:http://earthquake.usgs.gov/eqcenter/catalogs/eqs1day-M2.5.xml?throttleEntries=false&consumer.userFixedDelay=true";).marshal().rss().convertBodyTo(String.class).process(new
Processor(){
        public void process(Exchange arg0) throws Exception {
                // doe soemthing
                getWeather();
        }
}).to("direct:earths");

// get weather information
public static void getWeather() throws Exception{
        context.addRoutes(new RouteBuilder() {
                public void configure() {
                
from("http://api.wxbug.net/getLiveWeatherRSS.aspx?ACode=xxxxxxxxx&lat=12&long=52&unittype=1&OutputType=1";).process(new
Processor(){
                                public void process(Exchange arg0) throws 
Exception {
                                        // do something
                                }
                        }).to("direct:earths");
                }
        });
}

The route in getWeather will be performed, when a new splitted rss-feed
comes in. And I will only need the weather once. The problem at the moment
is, that I get the weather information often. So does anyone have an idea,
what to to?

Thanks

ad86
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Use-a-route-only-once-tp3351204p3351204.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to