Zookeeper Cluster Service

Spring Boot auto-configuration for the Camel ZooKeeper Cluster Service.

This starter provides leader election and cluster coordination for Camel routes using Apache ZooKeeper as the distributed backend. It integrates with Camel’s CamelClusterService SPI so you can use the clustered route controller to ensure only one instance of a route runs across a cluster.

Maven coordinates

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-zookeeper-cluster-service-starter</artifactId>
</dependency>

Usage

To use this cluster service, enable the clustered route controller and configure routes with routePolicy=ClusteredRoutePolicy:

# enable the cluster service
camel.cluster.zookeeper.enabled = true

# enable the clustered route controller
camel.clustered.controller.enabled = true

Spring Boot Auto-Configuration

The starter supports 21 options, which are listed below.

Name Description Default Type

camel.cluster.zookeeper.attributes

Custom service attributes.

Object>

camel.cluster.zookeeper.auth-info-list

AuthInfo>

camel.cluster.zookeeper.base-path

The base path to store in ZooKeeper.

String

camel.cluster.zookeeper.connection-timeout

Connection timeout.

15000

Long

camel.cluster.zookeeper.connection-timeout-unit

TimeUnit

camel.cluster.zookeeper.curator-framework

Zookeeper CuratorFramework-style client.

CuratorFramework

camel.cluster.zookeeper.enabled

Sets if the zookeeper cluster service should be enabled or not, default is true.

true

Boolean

camel.cluster.zookeeper.id

Cluster Service ID

String

camel.cluster.zookeeper.max-close-wait

Time to wait during close to join background threads.

1000

Long

camel.cluster.zookeeper.max-close-wait-unit

TimeUnit

camel.cluster.zookeeper.namespace

ZooKeeper namespace. If a namespace is set here, all paths will get pre-pended with the namespace.

String

camel.cluster.zookeeper.nodes

The Zookeeper server hosts (multiple servers can be separated by comma).

String>

camel.cluster.zookeeper.order

Service lookup order/priority.

Integer

camel.cluster.zookeeper.reconnect-base-sleep-time

Initial amount of time to wait between retries.

0

Long

camel.cluster.zookeeper.reconnect-base-sleep-time-unit

TimeUnit

camel.cluster.zookeeper.reconnect-max-retries

Max number of times to retry.

3

Integer

camel.cluster.zookeeper.reconnect-max-sleep-time

Max time to sleep on each retry. Default is Integer.MAX_VALUE.

Long

camel.cluster.zookeeper.reconnect-max-sleep-time-unit

TimeUnit

camel.cluster.zookeeper.retry-policy

Retry policy to use.

RetryPolicy

camel.cluster.zookeeper.session-timeout

Session timeout.

60000

Long

camel.cluster.zookeeper.session-timeout-unit

TimeUnit