...
| Camel 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 (by type) | Code Block |
---|
| @BeanInject
MyBean bean; |
| Code Block |
---|
| @Inject
MyBean bean;
|
|
Bean injection (by name) | Code Block |
---|
| @BeanInject("foo")
MyBean bean; |
| Code Block |
---|
| @Inject
@Named("foo")
MyBean bean;
|
|
POJO consuming | Code Block |
---|
| @Consume(uri = "seda:inbound")
void consume(@Body String body) {
//...
} |
| |
Bean component
You can refer to CDI bean, either by type or name, From the Camel DSL, e.g. with the Java Camel DSL:
Code Block |
---|
|
class MyBean {
//...
}
from("direct:inbound").bean(MyBean.class); |
Or by name:
Code Block |
---|
|
@Named("foo")
class MyBean {
//...
}
from("direct:inbound").bean("foo"); |
Camel events to CDI events
...