apache-camel Camel Domain Specific Language


Example

Camel's DSL (Domain Specific Language) is one of the features that makes Camel standout from other Integration frameworks. While some other frameworks also feature a DSL concept, typically in the form of a XML file, the DSL was in such cases always a custom based language.

Camel offers multiple DSLs in programming languages such as Java, Scala, Groovy, and in XML.

For example a simple file copy route can be done in various ways as shown in the list below

  • Java DSL

    from("file:data/in").to("file:data/out");
    
  • Blueprint/Spring DSL (XML)

    <route>
      <from uri="file:data/inbox"/>
      <to uri="file:data/out"/>
    </route>
    
  • Scala DSL

    from "file:data/inbox" -> "file:data/out"