Re: Dynamic datasource with Camel 2.15.x

2015-10-13 Thread burner
Thank you for your help. But I don't get it to run. I think this is also a too complex way. I solve my problem now with subclassing the JDBC Component and insert there my Code. Now my Component creates the DataSource on basis of Parameters. -- View this message in context: http://camel.465427.

Re: Dynamic datasource with Camel 2.15.x

2015-10-06 Thread Joakim Bjørnstad
Well now this isn't a Camel question but rather a Spring one. Anyways, I suggest checking out Spring @Value annotation and PropertyPlaceholderConfigurer. With this you can leverage Camel's BridgePropertyPlaceholderConfigurer to configure your routes as well. http://camel.apache.org/using-property

Re: Dynamic datasource with Camel 2.15.x

2015-10-06 Thread burner
Hello Joakim, yes, I am use Spring. your Idea look good. But how can I use parameters in your solution? @Configuration public class InfrastructureConfig { String username = ""; String password = ""; String url = ""; @Bean public DataSource dataSource() { String

Re: Dynamic datasource with Camel 2.15.x

2015-10-02 Thread Joakim Bjørnstad
Hello, First of all, it seems you use Spring with Camel. The PropertyPlaceholderDelegateRegistry delegates to the Spring ApplicationContextRegistry and not any JndiRegistry. Using this, I don't think you can go this route, since the ApplicationContextRegistry only allows lookup. And it does this

Re: Dynamic datasource with Camel 2.15.x

2015-10-02 Thread fxthomas
hello, You could try with SimpleRegistry. It worked fine for me ,though never tried with PropertyPlaceholderDelegateRegistry. SimpleRegistry reg = new SimpleRegistry(); I load a lot of beans during camel start time using camel context Object camelContext = new DefaultCamelContext(loadBeans());

Dynamic datasource with Camel 2.15.x

2015-10-02 Thread burner
Hello Together, i want to create dynamic datasources on runtime. I found some examples to do this. But this code: PropertyPlaceholderDelegateRegistry registry = (PropertyPlaceholderDelegateRegistry) getContext().getRegistry(); JndiRegistry jndiRegistry = (JndiRegistry ) registry.getRegistry(); jn