Quantcast

Camel with BeanFactory

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Camel with BeanFactory

kalyan
Hello,

I understand by skimming over Camel's source code that it uses
ApplicationContext everywhere.

In a project that I'm working on, I HAVE to use BeanFactory only. Is it
possible to initialize and use Camel's capabilities in a BeanFactory
instead of ApplicationContext at all ?

If so, what are the classes that I need to overwrite. Any documentation on
this will be of great help.

Regards,
Kalyan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Camel with BeanFactory

Claus Ibsen-2
Hi

What do you mean HAVE to use BeanFactory? Do you mean that
camel-spring source code must not use ApplicationContext or any of the
other Spring public APIs ?

Well you can write you own camel module. Or just not use camel-spring
at all, and just use camel-core which is Java code and has not
dependencies to Spring.



On Mon, Apr 29, 2013 at 7:21 PM, Kalyan Dev <[hidden email]> wrote:

> Hello,
>
> I understand by skimming over Camel's source code that it uses
> ApplicationContext everywhere.
>
> In a project that I'm working on, I HAVE to use BeanFactory only. Is it
> possible to initialize and use Camel's capabilities in a BeanFactory
> instead of ApplicationContext at all ?
>
> If so, what are the classes that I need to overwrite. Any documentation on
> this will be of great help.
>
> Regards,
> Kalyan



--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Camel with BeanFactory

kalyan
Hello Claus,

Thank you for the reply.

If I can elaborate my scenario, I want camel to run on a tomcat and there are few core modules of a proprietary framework already deployed (which use spring 3.2.0.Release). When a WAR is deployed, it will have a BeanFactory implementation class (and not applicationContext). And so, I want to get camel to work with spring but using BeanFactory but not ApplicationContext.

You mean to say that I have to rewrite all camel-spring classes or there is any specific set of classes to start with ?

Thanks again.

Regards,
Kalyan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Camel with BeanFactory

Claus Ibsen-2
Hi

Sounds scary.

Do you want to use the Spring XML DSL and all that? Then I guess it
may be a long journey.
Maybe you can build some kind of ApplicationContext facade from the
BeanFactory and use that.

Well for what its worth, then check camel-core-xml, and camel-spring
as they are the stuff for the Spring integration with Camel.





On Tue, Apr 30, 2013 at 1:56 PM, kalyand <[hidden email]> wrote:

> Hello Claus,
>
> Thank you for the reply.
>
> If I can elaborate my scenario, I want camel to run on a tomcat and there
> are few core modules of a proprietary framework already deployed (which use
> spring 3.2.0.Release). When a WAR is deployed, it will have a BeanFactory
> implementation class (and not applicationContext). And so, I want to get
> camel to work with spring but using BeanFactory but not ApplicationContext.
>
> You mean to say that I have to rewrite all camel-spring classes or there is
> any specific set of classes to start with ?
>
> Thanks again.
>
> Regards,
> Kalyan
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-with-BeanFactory-tp5731764p5731793.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Camel with BeanFactory

kalyan
Hi again..

I'm checking camel-spring currently and experimenting with few classes.

My goals are in the following order:
- Get Java DSL working and the Routes be Spring-injected so that I could pump in some data by fetching it from database
- Get Dataformats and transformations working
- To be able to make REST calls outside the server with http component or with bridgeEndpoint=true
- Get direct-vm, vm, seda calls working between multiple camel contexts
- Finally, Get Spring DSL working (good to have)

Is it possible for you to give them (goals) some weights (say fibonocci) in terms of effort I might endup spending. It would greatly help me in negotiating my deliverables.

Probably a lame question but what does camel-core-xml contain ?

Regards,
Kalyan

P.S: I have read Camel-in-Action and it has been of good help. Thank you :)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Camel with BeanFactory

Claus Ibsen-2
Hi

Its probably easier to create custom
- SpringRegistry
- SpringInjector

that uses BeanFactory instead of what Camel offers.

See the source code in camel-spring.

And then just create Camel as
SpringCamelContext camel = new SpringCamelContext();
camel.setInjector(new MyBeanFactoryInjector());
camel.setRegistry(new MyBeanFactoryRegistry());


eg use custom injector and registry. And possible something else down the road.
But that should get you on a start with Spring. This works with the Java DSL.

For XML DSL, then that's much harder, as you would need to use a
custom CamelContextFactoryBean.


On Tue, Apr 30, 2013 at 4:41 PM, kalyand <[hidden email]> wrote:

> Hi again..
>
> I'm checking camel-spring currently and experimenting with few classes.
>
> My goals are in the following order:
> - Get Java DSL working and the Routes be Spring-injected so that I could
> pump in some data by fetching it from database
> - Get Dataformats and transformations working
> - To be able to make REST calls outside the server with http component or
> with bridgeEndpoint=true
> - Get direct-vm, vm, seda calls working between multiple camel contexts
> - Finally, Get Spring DSL working (good to have)
>
> Is it possible for you to give them (goals) some weights (say fibonocci) in
> terms of effort I might endup spending. It would greatly help me in
> negotiating my deliverables.
>
> Probably a lame question but what does camel-core-xml contain ?
>
> Regards,
> Kalyan
>
> P.S: I have read Camel-in-Action and it has been of good help. Thank you :)
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-with-BeanFactory-tp5731764p5731807.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Camel with BeanFactory

kalyan
Thanks a lot for your suggestions. I will try to follow your guidelines and shall keep you posted
Loading...