Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the asciidoc in the repository: https://github.com/apache/camel/blob/master/README.md https://github.com/apache/camel/blob/master/components/readme.adoc
Just like the Java DSL, the Scala DSL has a RouteBuilder class (
From Camel 2.15 onwards use org.apache.camel.scala.dsl.builder.ScalaRouteBuilder and pass in the CamelContext in the constructor, which will be used by the builder. The old class RouteBuilder is deprecated.
If you compare this to the Java DSL, you notice:
Setting the route ID
To assign the unique ID to the Scala route, insert the
Creating a new Camel Scala project
Camel offers Maven archetypes that allow you to quickly setup a new project.
To do this, you can execute the following Maven goal from the command line (using Maven 3.0.3 or better):
This runs Maven interactively - just type
The generated project has a "readme" file with more instructions, and is ready to compile and run from Maven using: