sometimes I have to add an object to camel registry (of course with java). In most cases it is a dataSource .
My problem is I can\'t figure out a general working way
If you are using Spring with camel you can register your bean in Application context and it will be get registered in ApplicationContextRegistry.
eg. ConfigurableListableBeanFactory beanFactory = ((ConfigurableApplicationContext) applicationContext).getBeanFactory(); beanFactory.registerSingleton("beantolookup", bean);
And you can look up camelContext.getRegistry().lookupByName("beantolookup")