According to http://camel.apache.org/cdi.html
@Inject
@Uri("direct:event")
ProducerTemplate producer;
void observeCdiEvents(@Observes String event) {
producer.sendBody(event);
}
from("direct:event")
.log("CDI event received: ${body}");
is equivalent to
@Inject
CdiEventEndpoint<String> cdiEventEndpoint;
from(cdiEventEndpoint).log("CDI event received: ${body}");
How do I convert the example with
producer.asyncSendBody(...)
to use CdiEventEndpoint . Thanks in advance!
I never actually tested this, but from the docs you should be able to replace "direct" with "seda" to go for asych:
After your clarification, I think you might be looking for the asynchronous routing engine in camel, which would be used by inserting threads() into the java dsl setup:
or regarding the cdi event setup