Versions Compared

Key

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

...

Code Block
languagejava
class MyRouteBean extends RoutesBuilderRouteBuilder {
 
	@Override
    public void configure() {
        from("jms:invoices").to("file:/invoices");
    }
}

...

Code Block
languagejava
@ContextName("camel-context")
class MyRouteBean extends RoutesBuilderRouteBuilder {
 
	@Override
    public void configure() {
        from("jms:invoices").to("file:/invoices");
    }
}

...

Similarly, the @Default qualifier can be used to observe Camel events for the default Camel context if multiples contexts exist, e.g.:

...

Code Block
languagejava
void onExchangeCompleted(@Observes @Default ExchangeCompletedEvent event) {
    // Called after the exchange 'event.getExchange()' processing has completed
}

In that example, if no qualifier is specified, the @Any qualifier is implicitly assumed, so that corresponding events for all the Camel contexts get received.

...

  • 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-test - demonstrates the testing features that are provided as part of the integration between Camel and 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.

See Also