Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the early version of the new website
https://camel.apache.org/staging/
We would very much like to receive any feedback on the new site, please join the discussion on the Camel user mailing list.
Bean InjectionWe support the injection of various resources using @EndpointInject or @BeanInject. This can be used to inject
Using @BeanInjectFrom Camel 2.13 onwards you can inject beans (obtained from the Registry) into your beans such as For example to inject a bean named foo, you can enlist the bean in the Registry such as in a Spring XML file: <bean id="foo" class="com.foo.MyFooBean"/> And then in a Java public class MyRouteBuilder extends RouteBuilder { @BeanInject("foo") MyFooBean foo; public void configure() throws Exception { .. } } If you omit the name, then Camel does a lookup by type, and injects the bean if there is exactly only one bean of that type enlisted in the Registry. @BeanInject MyFooBean foo; |