Hi Declan - I have implemented a similar use case where we have a managed service factory (MSF) created for each directory a user wants to monitor for files deposited in it. When the MSF is created a camel route is dynamically configured to forward the file to our custom camel component that processes the file.
I define the MSF and the camel context in a Spring DM beans.xml file, injecting the camel context into the MSF class. This all works fine, except when the OSGi container (Karaf v2.3.2 in this case) is stopped/started - when the bundle with my MSF is restarted it does not restart any camel routes that may have been created to monitor directories. If I add code to dump the routes in the injected camel context, the routes are indeed there, but Camel does not start them. And if I add code to explicitly start them myself, Camel still does not start them. This only happens when routes exist and the bundle (or entire OSGi container) are restarted. I posted details on this Camel thread http://camel.465427.n5.nabble.com/Dynamic-route-not-started-when-OSGi-bundle-it-is-in-is-uninstalled-and-then-reinstalled-td5739282.html but no replies. Thought I would ping you since you have done a very similar use case. Would you have any ideas as to what might be wrong? I can provide further details of what I am doing if that would be helpful. Thanks - Hugh -- View this message in context: http://camel.465427.n5.nabble.com/Using-ManagedServiceFactory-to-dynamically-deploy-routes-tp5719969p5739665.html Sent from the Camel - Users mailing list archive at Nabble.com.