O'Reilly logo

Clojure Programming Cookbook by Nicolas Modrzyk, Makoto Hashimoto

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Apache Camel to connect everything

Apache Camel is a rule-based routing and mediation engine that provides the Enterprise Integration Patterns using an API or declarative Java domain-specific language to configure routing and mediation rules.

Getting ready

In this recipe, we will use the Java Camel library. So, you need to add the org.apache.camel/camel-core to your project.clj:

(defproject chapter04 "0.1.0" 
:dependencies [[org.clojure/clojure "1.8.0"] 
                 [org.apache.camel/camel-core "2.16.1"] 

How to do it...

Here, we will learn basic uses of Camel from Clojure.

Importing Camel classes

The following code imports the Camel classes that we will use:

(ns chapter04.camel (:import [org.apache.camel.impl DefaultCamelContext] [org.apache.camel.builder RouteBuilder] ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required