...
The Camel CDI component provides auto-configuration for Apache Camel using CDI as dependency injection framework based on the on convention-over-configuration principle. It auto-detects Camel routes available in the application and provides beans for common Camel primitives like Endpoint
, ProducerTemplate
or TypeConverter
. It implements standard Camel bean integration so that Camel annotations like @Consume
, @Produce
and @PropertyInject
can be used seamlessly in CDI beans. Besides, it bridges Camel events (e.g. RouteAddedEvent
, CamelContextStartedEvent
or ExchangeCompletedEvent
) as CDI events and provides a CDI events endpoint that can be used to consume / produce CDI events from / to Camel routes.
...
Code Block | ||
---|---|---|
| ||
@ApplicationScoped class CustomCamelContext extends DefaultCamelContext { @PostConstruct void customize() { // Set the Camel context name setName("custom"); // Disable JMX disableJMX(); } @PreDestroy void cleanUp() { // ... } } |
Producer and disposer methods can also be used as well to customize the Camel context bean, e.g.:
...