THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Bean component
You can refer to CDI beanbeans, either by type or name, From the Camel DSL, e.g. with the Java Camel DSL:
...
Code Block | ||
---|---|---|
| ||
@Named("foo") class MyBean { //... } from("direct:inbound").bean("foo"); |
Referring beans from Endpoint URIs
When configuring endpoints using the URI syntax you can refer to beans in the Registry using the #
notation. If the URI parameter value starts with a #
sign then Camel CDI will lookup for a bean of the given type by name, e.g.:
Code Block | ||
---|---|---|
| ||
from("jms:queue:{{destination}}?transacted=true&transactionManager=#jtaTransactionManager").to("...");
@Produces
@Named("jtaTransactionManager")
PlatformTransactionManager createTransactionManager(TransactionManager transactionManager, UserTransaction userTransaction) {
JtaTransactionManager jtaTransactionManager = new JtaTransactionManager();
jtaTransactionManager.setUserTransaction(userTransaction);
jtaTransactionManager.setTransactionManager(transactionManager);
jtaTransactionManager.afterPropertiesSet();
return jtaTransactionManager;
} |
Camel events to CDI events
...