Sunday, October 14, 2012

New JGroups component for Camel is out

Starting from the version 2.10.0 of Camel you can use new JGroups component.

JGroups is a toolkit for reliable multicast communication. The latter communication is usually (but not only) based on the IP multicast. I personally find JGroups-based communication extremely useful for clustering almost anything.

With new Camel component you can broadcast multicast messages to the JGroups cluster. For example when you save message to the persistent store, you may like to notify some other parties that they need to invalide cached data.
from("direct:persistDataEvent").
multicast().parallelProcessing().
  to("sql:insert into MyTable (column1, column2) values (#,#)", 
     "jgroups:MyTableCacheInvalidation");
On the other hand, when you need to listen for the multicast notification, you can use JGroups component on the consumer side of the route. For example to listen for the cache invalidation events you could use the route below.
from("jgroups:MyTableCacheInvalidation").
to("bean:myTableCache?method=invalidate")

Due to the licensing issues (JGroups is licensed under LGPL) this component is developed under the umbrella of the Camel Extra project.

And here are Maven coordinates for new artifact:
<dependency>
  <groupId>org.apache-extra.camel</groupId>
  <artifactId>camel-jgroups</artifactId>
  <version>x.x.x</version>
  <!-- use the same version as your Camel core version -->
</dependency>

Enjoy your ride with new Camel in our herd :) .

3 comments:

  1. Hi, the JGroups component is working great in standard mode. I'm currently trying UNICAST mode on the endpoint using the messageProperties option but i'm getting the following error: "Unknown parameters=[{channelProperties=NAKACK:UNICAST}]"

    ReplyDelete
  2. Hi,

    I'll check this issue and create the patch if necessary. Thanks for reporting.

    ReplyDelete
  3. The issue has been fixed and released with Camel Extra 2.10.2 - https://code.google.com/a/apache-extras.org/p/camel-extra/issues/detail?id=37 .

    ReplyDelete