Java DSL

Camel uses a Java Domain Specific Language or DSL for creating Enterprise Integration Patterns or Routes. Camel also supports a Spring based XML configuration as well as a Scala DSL.

The benefits of using the Java DSL is that your IDE can smart complete your code as you start typing, rather than having to mess around with buckets of XML. The Java DSL is also very expressive as you can mix and match your own code within the language for Expression or Predicate evaluations or easily add a custom Processor.

The main entry points for the DSL are

  • CamelContext for creating a Camel routing rulebase
  • RouteBuilder for creating a collection of routes using the routing DSL

Handling errors

You can handle errors in a number of ways such as:

Camel uses a strategy to resolve how exceptions should be handled.

Using try ... catch ... finally

See Try Catch Finally

Using Interceptors

See Intercept

See Also

For more examples of the DSL in action see

© 2004-2011 The Apache Software Foundation.
Apache Camel, Camel, Apache, the Apache feather logo, and the Apache Camel project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram