java - refresh apache camel routes -
i using spring camel
standalone application builds many routes
depending on returned psql database
:
private void addendpoint(string urlname, string type, string host, string port, string username, string password) { string endpointurl = string.format("https://%s:%s?username=%s&password=%s", host, port, username, password); from("direct:endpoint_" + urlname) .throttle(1).timeperiodmillis(60000) .to(endpointurl); }
and route
created in loop depends on returned database this:
@override public void configure() throws exception { final list<url> url= dburldao.geturl(); (url urlinfo : urls) { addendpoint(urlinfo.getname(), urlinfo.gettype(), urlinfo.getip(), urlinfo.getport(),urlinfo.getusername(), urlinfo.getpassword()); }
what acheive able add route
without restarting application (route builder being initialized camel-context.xml).
is there anyway force running application refresh camel context
?
yes can add / remove routes @ runtime. there api on camelcontest that, , examples can google find / read books etc.
Comments
Post a Comment