You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Spring Support

Apache Camel is designed to work nicely with the Spring Framework in a number of ways.

  • Camel uses Spring Transactions as the default transaction handling in components like JMS and JPA
  • Camel works with Spring 2 XML processing with the Xml Configuration
  • Camel integrates with various Spring helper classes; such as providing Type Converter support for Spring Resources etc
  • Allows Spring to dependency inject Component instances or the CamelContext instance itself and auto-expose Spring beans as components and endpoints.

Using Spring to configure the CamelContext

You can configure a CamelContext inside any spring.xml using the CamelContextFactoryBean. This will automatically start the CamelContext along with any referenced Routes.

Using Spring you can configure Routes in two ways

Using Java Code

You can use Java Code to define your RouteBuilder implementations, then in your spring.xml you can specify the Java package names to search for (recursively) to find your routes.

Error formatting macro: snippet: java.lang.NullPointerException

Using Spring XML

You can use Spring 2.0 XML configuration to specify your Xml Configuration for Routes.

Error formatting macro: snippet: java.lang.NullPointerException
  • No labels