Consul Cluster Service

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

This starter provides leader election and cluster coordination for Camel routes using HashiCorp Consul 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-consul-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.consul.enabled = true
camel.cluster.consul.url = http://localhost:8500

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

Spring Boot Auto-Configuration

The starter supports 27 options, which are listed below.

Name Description Default Type

camel.cluster.consul.acl-token

Sets the ACL token to be used with Consul

String

camel.cluster.consul.attributes

Custom service attributes.

Object>

camel.cluster.consul.block-seconds

The time (in seconds) to wait for a watch event, default 10 seconds

10

Integer

camel.cluster.consul.connect-timeout

Connect timeout for OkHttpClient

Duration

camel.cluster.consul.consistency-mode

The consistencyMode used for queries, default ConsistencyMode.DEFAULT

default

ConsistencyMode

camel.cluster.consul.datacenter

The data center

String

camel.cluster.consul.enabled

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

true

Boolean

camel.cluster.consul.first-index

The first index for watch for, default 0

0

BigInteger

camel.cluster.consul.id

Cluster Service ID

String

camel.cluster.consul.near-node

The near node to use for queries.

String

camel.cluster.consul.node-meta

The note meta-data to use for queries.

String

camel.cluster.consul.node-metas-as-list

String>

camel.cluster.consul.order

Service lookup order/priority.

Integer

camel.cluster.consul.password

Sets the password to be used for basic authentication

String

camel.cluster.consul.ping-instance

Configure if the AgentClient should attempt a ping before returning the Consul instance

true

Boolean

camel.cluster.consul.read-timeout

Read timeout for OkHttpClient

Duration

camel.cluster.consul.recursive

Recursively watch, default false

false

Boolean

camel.cluster.consul.root-path

Consul root path

/camel

String

camel.cluster.consul.session-lock-delay

The value for lockDelay

5

Integer

camel.cluster.consul.session-refresh-interval

The value of wait attribute

5

Integer

camel.cluster.consul.session-ttl

The value of TTL

60

Integer

camel.cluster.consul.ssl-context-parameters

SSL configuration using an org.apache.camel.support.jsse.SSLContextParameters instance.

SSLContextParameters

camel.cluster.consul.tag-as-set

String>

camel.cluster.consul.tags

Set tags. You can separate multiple tags by comma.

String

camel.cluster.consul.url

The Consul agent URL

String

camel.cluster.consul.user-name

Sets the username to be used for basic authentication

String

camel.cluster.consul.write-timeout

Write timeout for OkHttpClient

Duration