Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

Since Camel version 2.17.0, Camel CDI is capable of managing any kind of CamelContext beans. In previous versions, it is only capable of managing beans of type CdiCamelContext so you need it is required to extend it.

The CDI qualifiers declared on the CamelContext beans are also used to bind the corresponding Camel primitives, e.g.:

...

ContainerVersionRuntime
Weld SE1.1.28.FinalCDI 1.0 / Java SE 7
OpenWebBeans

1.2.7

CDI 1.0 / Java SE 7
Weld SE

2.3.23.Final

CDI 1.2 / Java SE 7
OpenWebBeans

1.6.23

CDI 1.2 / Java SE 7
WildFly8.2.1.FinalCDI 1.2 / Java EE 7
WildFly9.0.1.FinalCDI 1.2 / Java EE 7
Karaf2.4.4CDI 1.2 / OSGi 4 / PAX CDI
Karaf3.0.5CDI 1.2 / OSGi 5 / PAX CDI
Karaf4.0.4CDI 1.2 / OSGi 6 / PAX CDI

...

The following examples are available in the examples directory of the Camel project:

  • camel-example-cdi - illustrates how to work with Camel using CDI to configure components, endpoints and beans,
  • camel-example-cdi-metrics - illustrates the integration between Camel, Dropwizard Metrics and CDI,
  • camel-example-cdi-properties - illustrates the integration between Camel, DeltaSpike and CDI for configuration properties,
  • camel-example-cdi-osgi - a CDI application using the SJMS component that can be executed inside an OSGi container using PAX CDI,
  • camel-example-cdi-rest-servlet - illustrates the Camel REST DSL being used in a Web application that uses CDI as dependency injection framework,
  • camel-example-widget-gadget-cdi - the Widget and Gadget use-case from the EIP book implemented in Java with CDI dependency Injection,
  • camel-example-swagger-cdi - an example using REST DSL and Swagger Java with CDI.

...