Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: [JGroups] Added enableViewMessages option example.

...

Name

Default Value

Description

channelProperties

null

Camel 2.10.0: Specifies configuration properties of the JChannel used by the endpoint.

enableViewMessagesfalseCamel 2.13.0:  Consumer only. If set to true, the consumer endpoint will receive org.jgroups.View messages as well (not only org.jgroups.Message instances). By default only regular messages are consumed by the endpoint.

Usage

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
java
java
// Send message to the cluster named 'clusterName'
from("direct:start").to("jgroups:clusterName");

Examples

Receive cluster view change notifications

The snippet below demonstrates how to create the consumer endpoint listening to the notifications regarding cluster membership changes. By default only regular messages are consumed by the endpoint.

Code Block
java
java
mockEndpoint.setExpectedMessageCount(1);
mockEndpoint.message(0).body().isInstanceOf(org.jgroups.View.class);
from("jgroups:clusterName?enableViewMessages=true").to(mockEndpoint);
mockEndpoint.assertIsSatisfied();