You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Felix Thomas <fe...@gmail.com> on 2015/08/21 11:04:06 UTC

Load Bean Definitions from XML in Camel

hello,

       I know we can load RouteDefinations from XML, but can we have the
same idea of loading for Beans from a XML like Spring. Is there anything
already available inAPI?

Regards,
Felix T

Re: Load Bean Definitions from XML in Camel

Posted by Henryk Konsek <he...@gmail.com>.
Hi Felix,

This really depends on the Camel registry [1] you are using. For OSGi
registries you can deploy new beans and processors as the OSGi bundles. For
Spring applications you can use the Spring Bean Registry API [2].

In general as soon as given bean will be available for the Camel registry
[1], Camel will be able to find it. However adding the bean at runtime is
something outside the scope of the Camel itself - you have to rely on your
IoC framework to do the heavy-lifting.

Cheers!

[1] http://camel.apache.org/registry.html
[2]
https://gopinathb4u.wordpress.com/2010/12/30/create-dynamic-spring-beans/

wt., 25.08.2015 o 09:12 użytkownik fxthomas <fe...@gmail.com>
napisał:

> hello Christain,
>
>     Sorry , I was not clear in the question.  I meant the bean tags in XML
> ,
> can it be loaded dynamically  in camel i.e. a java method which will get
> the
> bean definations from a DB rather that hardcoding it in XML.
>
> I know that using a complex Java reflection I can load the class and bind
> it
> in the registry via the BIND method of the MAIN Class.  I was wondering
> just
> like the loadRoutes method which can accept a XML stream , can I do the
> same
> for the java beans (which are mostly processor & datasoource entries).
>
>
> Hope I was clear
>
> regards,
> Felix T
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Load-Bean-Definitions-from-XML-in-Camel-tp5770892p5770958.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
-- 
Henryk Konsek
http://about.me/hekonsek

Re: Load Bean Definitions from XML in Camel

Posted by fxthomas <fe...@gmail.com>.
hello Christain, 

    Sorry , I was not clear in the question.  I meant the bean tags in XML ,
can it be loaded dynamically  in camel i.e. a java method which will get the
bean definations from a DB rather that hardcoding it in XML.  

I know that using a complex Java reflection I can load the class and bind it
in the registry via the BIND method of the MAIN Class.  I was wondering just
like the loadRoutes method which can accept a XML stream , can I do the same
for the java beans (which are mostly processor & datasoource entries).
 

Hope I was clear    

regards,
Felix T



--
View this message in context: http://camel.465427.n5.nabble.com/Load-Bean-Definitions-from-XML-in-Camel-tp5770892p5770958.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Load Bean Definitions from XML in Camel

Posted by Christian Müller <ch...@gmail.com>.
I didn't got the question...

You can create a Camel route from (Spring) XML or you can use Java Code,
e.g. implementing a RouteBuilder.

Best,

Christian
-----------------

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member

https://www.linkedin.com/pub/christian-mueller/11/551/642

On Fri, Aug 21, 2015 at 11:04 AM, Felix Thomas <fe...@gmail.com>
wrote:

> hello,
>
>        I know we can load RouteDefinations from XML, but can we have the
> same idea of loading for Beans from a XML like Spring. Is there anything
> already available inAPI?
>
> Regards,
> Felix T
>