how we can add new route to my existing camelContext without stopping main application?
For example already i have started the camel context which is having the routeId with name hello. but now without stopping our application I want to add another route named bye and call some http service and get the response and log that one.
i tried to get the instance of existing CamelContext by using static field like
i have added two things in my main application
- static field to hold the camelContext instance. and
- Getter method(getCamelContext) to access the CamelContext Instance and returned the camelContext here.
then i have created a class named DynamicRouteAdder
in this i have created main method and call the getCamelContext method of main application.
and i have added new route to camelContext instance.
but while running DynamicRouteAdder i am getting nullpointerexception(means getCamelContext returning null for me).
Umair Shaikh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.