1

I have a requirement where by the application will need to be periodically refreshed to subscribe from different end points. I am using Apache Camel for orchestration and I am comfortable subscribing to an end point.

I have a routebuilder class as follows:

public class SampleRouteBuilder extends RouteBuilder {

   @Override
   public void configure() throws Exception {

    String... subscriptionTopicUris = someService.getUris();

    // Simple logic - read from URIs and write to topic
    from(subscriptionTopicUris) //
                .to(destinationUri) //
                .routeId("SAMPLE_ROUTE_ID");
   }
}

I run a scheduled job with a given time interval and I remove the route from Camel Context, stop the context and add it back and start the context. However, the configure method is not fired on starting the context and hence the service (someService) possibly returning a different list of URIs is never fired.

How do I reload the route?

I am using Spring, Apache Camel and annotation based approach and this is a web application running in jetty.

Thanks

Mahesh
  • 335
  • 1
  • 4
  • 19
  • Have you seen the answers here? http://stackoverflow.com/questions/23355393/best-way-to-load-dynamically-routes-in-apache-camel – mdnghtblue Aug 12 '15 at 18:03
  • Yes, I have and I tried following the suggestion of removing routes and adding a route to the context.. However, on re-adding the route, it looks the configure method is not get invoked.. and that's what my question was about... – Mahesh Aug 13 '15 at 10:32

0 Answers0