...
Note that CDI injection is supported within the type converters.
Camel bean integration
Camel annotations
As part of the Camel bean integration, Camel comes with a set of annotations that are seamlessly supported by Camel CDI. So you can use any of these annotations in your CDI beans, e.g.:
...
annotation | CDI equivalent |
---|
Configuration property | Code Block |
---|
| @PropertyInject("property")
String property;
|
| If using DeltaSpike configuration mechanism: Code Block |
---|
| @Inject
@ConfigProperty(name = "message")
String property; |
See configuration properties for more details. |
Producer template injection (default Camel context) | Code Block |
---|
| @Produce(uri = "mock:outbound")
ProducerTemplate producer; |
| Code Block |
---|
| @Inject
@Uri("direct:outbound")
ProducerTemplate producer; |
|
Endpoint injection (default Camel context) | Code Block |
---|
| @EndpointInject(uri = "direct:inbound")
Endpoint endpoint; |
| Code Block |
---|
| @Inject
@Uri("direct:inbound")
Endpoint endpoint; |
|
Endpoint injection (Camel context by name) | Code Block |
---|
| @EndpointInject(uri = "direct:inbound", context = "foo")
Endpoint contextEndpoint; |
| Code Block |
---|
| @Inject
@ContextName("foo")
@Uri("direct:inbound")
Endpoint contextEndpoint; |
|
Bean injection | Code Block |
---|
| @BeanInject
MyBean bean; |
| Code Block |
---|
| @Inject
MyBean bean;
|
|
POJO consuming | Code Block |
---|
| @Consume(uri = "seda:inbound")
void consume(@Body String body) {
//...
} |
| |
Camel events to CDI events
...