Skip to content
Branch: master
Find file History
Type Name Latest commit message Commit time
Failed to load latest commit information.
src added annotations to fix NotNull issues with camel Sep 12, 2012 initial checkin of Jun 28, 2012
pom.xml initial checkin of Jun 28, 2012

Kool Camel

Kool Camel provides a kotlin based DSL for Apache Camel which is a powerful extension to the Java DSL with Kool Expressions together with adding integration with Kool Streams to provide a typesafe Camel Integration and Event Processing DSL.

Kool Expressions

The power of the Kool Camel DSL comes from the use of Kool Expressions. These are anonymous function blocks used wherever you can use Camel Expression in the Java DSL. The function blocks take an implicit Camel Exchange object which lets you immediately refer to any of the existing exchange methods together with the extension methods on Exchange without requiring extra noise like a '_' expression in Scala, an 'it' variable in Groovy or a named parameter declaration and variable in Java 8 lambdas which keeps the DSL nice and DRY.

For example you can refer to the input property to get the inbound Message or out for the outbound message and refer to headers or properties using the subscript operators

Kool Camel DSL examples

Here are various example patterns using the Kool Camel DSL to show you how DRY it is while still being very easy to read (even if you've never used kotlin before) and how Kool Expressions are integrated into the entire Java DSL:

Camel and Kool Streams

Kool Camel allows you to turn any Camel Endpoint into a Stream<T> using a number of helper methods on the Camel Endpoint class. Once you have a typesafe Stream<T> you can then compose event processing steps (filtering, transforming, grouping, buffering, windowing, merging, correlating etc) with Kool Streams to perform powerful complex event processing.

On the flip side, you can easily send events on a Kool Stream to any Camel Endpoint using the to(Endpoint) extension method.

This allows us to easily compose any Kool Streams and Camel Endpoints and Routes together to combine powerful integration and complex event processing capabilities into a single simple type safe DSL that works directly on your domain model and generates fast statically typed java bytecode without the need for reflection or dynamic invocation.

While the Kool Camel and Stream DSLs are Kotlin based; they obviously can easily work with any JVM code for domain models, functions and services; so its easy to reuse Kool Camel routes and Streams from Java, Scala, Groovy, JavaScript, JRuby in addition to the Kotlin language.

IDE support

If you've not tried Kotlin yet, try the Getting Started Guide to install the IDE plugin.

You can’t perform that action at this time.