...
Name | Default Value | Description |
---|---|---|
|
| Camel 2.10.0: Specifies configuration properties of the JChannel used by the endpoint. |
enableViewMessages | false | Camel 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 | ||||
---|---|---|---|---|
| ||||
// 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 | ||||
---|---|---|---|---|
| ||||
mockEndpoint.setExpectedMessageCount(1); mockEndpoint.message(0).body().isInstanceOf(org.jgroups.View.class); from("jgroups:clusterName?enableViewMessages=true").to(mockEndpoint); mockEndpoint.assertIsSatisfied(); |