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.
I always begin to acquire the registry:
getContext().getRegistry();
But "Registry" does not have any method to add an object. So I have to try (with debugger) what kind of registry is in use
getContext().getRegistry(some.class)<some method to add something>;
For example in one project (camel blueprint) I have to call
SimpleRegistry registry = new SimpleRegistry();
registry.put("some", bean);
getContext().getRegistry(CompositeRegistry.class).addRegistry(registry);
Now I created a project with same structure (also same maven parent) but now the code from above stops working because for some reason now camel uses a PropertyPlaceholderDelegateRegistry
I am sure there will be code to add my bean but;
Is there code that works with every setup to add something to camels registry?