Tag Archives: EIP

Drools channels and Apache Camel integration.

The previous posts only showed how to build a route using the Drools endpoint as the target consumer of the message, but what happen if we need to start the route from a Drools endpoint (the source endpoint) and send a message from the rules consequence to the target endpoint? In this case we need to use Drools channels.

A Drools channel provides a mechanism to send objects from the working memory to some external process or functions.
Continue reading


Drools Camel Integration

The Apache Camel integration allows us to interact with a Drools Stateless or Stateful session through a pipeline. It basically works by transforming XML commands into executable commands and executing each of them. The advantage of this integration is that Apache Camel makes possible the implementation of more advanced enterprise integration patterns, which is an improvement of Drools Pipeline.

This integration with Drools allows us to add any of the current Camel components. Using the Apache Components you can, receive commands from several entry points and send the execution result to another entry point. Just to name a few of the components: JMS queue/Atom Feed/Mina connection/a Mail/etc. As you can see, this brings a more powerful interoperability mechanism to integrate your application with Drools. Actually Drools is using Camel 2.4.0 that allows a more strong internal integration between them.

Introduction to Drools Grid
This integration is coupled with another drools module called: drools-grid. This module allow us to interact with Drools sessions independent of the JVM location. At the moment we can use two implementations:

  • Local: Used when the drools sessions and clients are in the same JVM
  • Remote: Used when you have drools sessions on a remote JVM. Currently, the only implementation is based on Apache Mina. HornetQ support is actually done, but don’t available in trunk

Drools Grid is embedded inside the Drools Camel component, so don’t worry about further implementation information because this is hidden by Drools. With this information we can start to configure our Camel Context.
Continue reading