Re: Spring bean injection best practice

2013-02-04 Thread Diether
'm just lazy and don't want to do it manually :-) Good point about the endpoints-intercepting though. But I don't have a need to intercept at the moment. But perhaps I should stick with my option #1, less boilerplate and it works as expected. -- View this message in context: htt

Re: Spring bean injection best practice

2013-02-02 Thread Christian Müller
And I prefer to("bean://my bean") because it's more inline with the other endpoints and easier to intercept if necessary. Just my 0.02 €, Christian Sent from a mobile device Am 01.02.2013 16:41 schrieb "Wuyts Diether" : > There are a few possibilities when using spring beans in your camel > rout

Re: Spring bean injection best practice

2013-02-01 Thread Taariq Levack
I don't know about best practices, often depends on use cases, but Camel will also cache the result of the registry lookup, if the bean is a singleton.[1] For instance you may not want to autowire all these services into your router, or even know which ones to autowire, then Camel can look it up in

Spring bean injection best practice

2013-02-01 Thread Wuyts Diether
There are a few possibilities when using spring beans in your camel routes. But I was wondering what the common best practice is. 1) Use the class in the .bean method: from("direct://start") .bean(MyService.class, "process") .end(); Normally Camel will then create a new instance of MyService cla