Just like the Java DSL, the Scala DSL has a RouteBuilder class (org.apache.camel.scala.builder.RouteBuilder
) class that you have to can extend to implement your own routes. This example shows you two very simple routes. :
Wiki Markup |
---|
{snippet:id=basic|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/BasicRouteBuilderTest.scala} |
...
Camel offers Maven archetypes which allows that allow you to quickly setup a new project.
To do this, you can use Maven an execute the following Maven goal from the command line (using Maven 3.0.3 or better):
Code Block |
---|
mvn archetype:generate |
This runs Maven in interactive mode, and then interactively - just type camel
and pres enter. This filters the list to only Camel related.
And from the list press <Enter> to filter for Camel-related archetypes.
From the list, pick the number for the camel-archetype-scala
. And , then fill in the remaining details from there, (such as the Camel version etc, et cetera).
The generated project created has a "readme" file with more instructions, and is read ready to compile and run from mvn as well Maven using:
Code Block |
---|
mvn compile exec:java
|