This content has been marked as final.
Show 3 replies
-
1. Re: Mixing DSL with Spring in Camel
davsclaus Mar 4, 2011 12:28 AM (in response to guest)You can use any kind of IoC to inject beans from the XML file in your Java code. For example Spring have a number of annotations. Or you can use the @Resource annotation from JDK1.6.
Something like this in the Java DSL class
@Resource(name = "myTransform") private MyTransform myTransform
You may need a getter/setter pair for it so the @Resource works. Can't remember if it can IoC without the setter.
-
2. Re: Mixing DSL with Spring in Camel
guest Mar 4, 2011 4:34 PM (in response to davsclaus)Doesnt look like that works. I get null for myTransform, even with getter/setter. It looks like the way the beans.xml in camel-osgi is configured, the DSL will get started first and the dependency injection never gets established for that attribute. Am I missing something? Thanks!
-
3. Re: Mixing DSL with Spring in Camel
davsclaus Mar 8, 2011 4:03 AM (in response to guest)What version of Fuse ESB / or Camel are you using?
And are you running the application in Fuse ESB or what other server?