Camel Spring Boot

JGroups

Exchange messages with JGroups clusters.

What’s inside

Please refer to the above links for usage and configuration details.

Maven coordinates

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-jgroups-starter</artifactId>
</dependency>

Spring Boot Auto-Configuration

The starter supports 9 options, which are listed below.

Name Description Default Type

camel.component.jgroups.accept-all-objects

Whether the consumer accepts any object deserialized from the cluster. When false, the consumer does not start unless a JVM-wide serial filter (-Djdk.serialFilter) is set, the jgroups.deserialization.filter system property is set, or the protocol stack of the channel has AUTH, SYM_ENCRYPT or ASYM_ENCRYPT; and the class of each message body is checked with deserializationFilter. When true, the consumer skips both checks and routes any class that JGroups deserializes, which is insecure.

false

Boolean

camel.component.jgroups.autowired-enabled

Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.

true

Boolean

camel.component.jgroups.bridge-error-handler

Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.

false

Boolean

camel.component.jgroups.channel

A JChannel that the application created, used by all the endpoints of the component instead of a JChannel that each endpoint creates, so channelProperties is not used. A JChannel joins one cluster: the first endpoint that connects it chooses the cluster name. Camel connects and disconnects this channel, but does not close it. The option is a org.jgroups.JChannel type.

JChannel

camel.component.jgroups.channel-properties

The JGroups protocol stack configuration (XML) of the JChannel that each endpoint creates: a file, a URL, or a classpath resource whose name ends with xml. Not used when the channel option is set. If not set, JGroups uses its default udp.xml: the UDP transport with IP multicast (group 239.8.8.8, port 45588, unless the jgroups.udp.mcast_addr and jgroups.udp.mcast_port system properties are set), no AUTH, no encryption (SYM_ENCRYPT or ASYM_ENCRYPT), and the JGroups diagnostics (probe) enabled without a passcode; the endpoint then logs a WARN when it starts. That stack is meant for development and tests: in production, set your own protocol stack, with AUTH and SYM_ENCRYPT or ASYM_ENCRYPT.

String

camel.component.jgroups.deserialization-filter

An ObjectInputFilter pattern (the jdk.serialFilter syntax) that the consumer checks against the class of the message body, the object that JGroups deserialized when it read the message from the network. Only the class of the body is checked, not the classes of the objects inside it. A refused message is not routed, and goes to the exception handler of the consumer. If not set, the JVM-wide serial filter is used, or when there is none, a default filter that rejects java.net. and allows only java., javax. and org.apache.camel.. Use * to accept any class. As this check runs after the deserialization, it cannot stop code that runs during it: for that, set -Djdk.serialFilter or the jgroups.deserialization.filter system property. Not used when acceptAllObjects is true.

String

camel.component.jgroups.enable-view-messages

Whether the consumer also routes an org.jgroups.View, the list of the members of the cluster, each time the view changes, starting with the view the channel receives when it joins the cluster. By default, the consumer routes only the objects sent in the messages.

false

Boolean

camel.component.jgroups.enabled

Whether to enable auto configuration of the jgroups component. This is enabled by default.

Boolean

camel.component.jgroups.lazy-start-producer

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.

false

Boolean