concept @inject in category camel
appears as: @Inject

This is an excerpt from Manning's book Camel in Action.
But we’ve chosen to show a practice often used with CDI, which is dependency injection, and why we inject the endpoints also. To call the bean, you can use
bean("helloBean", "hello")❹ to refer to the bean by its name and the name of the method to invoke. But you also could have injected the bean by using CDI. This can be done using@Injectand@Named, as shown in the following code snippet:
Listing 7.3 Injecting bean using CDI
@Inject@Singleton public class HelloRoute extends RouteBuilder { @Inject #1 private HelloBean hello; public void configure() throws Exception { from("jetty:http://localhost:8080/hello") .bean(hello, "sayHello"); #2 } } #1 Dependency injects the HelloBean using @Inject #2 Calls the method sayHello on the injected HelloBean instanceBecause you want to use the
HelloBeanin the Camel route, you can instruct CDI to dependency-inject an instance of the bean by declaring a field and annotate the field with@Inject❶. The bean can then be used in the Camel route as a bean method call ❷.