...
Tip |
---|
title | Available since Camel 2.10.0 |
---|
|
|
JGroups is a toolkit for reliable multicast communication. The jgroups: component provides exchange of messages between Camel infrastructure and JGroups clusters.
Maven users will need to add the following dependency to their pom.xml
for this component:.
Code Block |
---|
|
<dependency>
<groupId>org.apache-extraextras.camel<camel-extra</groupId>
<artifactId>camel-jgroups</artifactId>
<!-- use the same version as your Camel core version -->
<version>x.xy.z</version>
</dependency>
|
Starting from the Camel 2.13.0, JGroups component has been moved from Camel Extra under the umbrella of the Apache Camel. If you are using Camel 2.13.0 or higher, please use the following POM entry instead.
Code Block |
---|
|
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jgroups</artifactId>x</version>
<!-- use the same version as your Camel core version -->
<version>x.y.z</version>
</dependency>
|
URI format
Code Block |
---|
jgroups:clusterName[?options]
|
...
Using jgroups
component on the consumer side of the route will capture messages received by the JChannel
associated with the endpoint and forward them to the Camel route. JGroups consumer processes incoming messages asynchronously.
Code Block |
---|
|
// Capture messages from cluster named
// 'clusterName' and send them to Camel route.
from("jgroups:clusterName").to("seda:queue");
|
Using jgroups
component on the producer side of the route will forward body of the Camel exchanges to the JChannel
instance managed by the endpoint.
Code Block |
---|
|
// Send message to the cluster named 'clusterName'
from("direct:start").to("jgroups:clusterName");
|