ZooKeeper Master
Run the consumer of an endpoint on only one node of a cluster, the master elected with ZooKeeper, with failover to another node when the master goes away.
What’s inside
-
ZooKeeper Master component, URI syntax:
zookeeper-master:groupName:consumerEndpointUri
Please refer to the above links for usage and configuration details.
Maven coordinates
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-zookeeper-master-starter</artifactId>
</dependency> Spring Boot Auto-Configuration
The starter supports 9 options, which are listed below.
| Name | Description | Default | Type |
|---|---|---|---|
camel.component.zookeeper-master.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.zookeeper-master.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.zookeeper-master.container-id-factory | A custom factory of the container id: the id of this node in the group, which is stored in the znode of the node. The default factory uses the runtime.id system property, or a random UUID. The id must be unique among the nodes of a group: when several znodes of a group have the same container id, only the newest of them counts. The option is a org.apache.camel.component.zookeepermaster.ContainerIdFactory type. | ContainerIdFactory | |
camel.component.zookeeper-master.curator | A started CuratorFramework client to connect to ZooKeeper with, instead of the client that the component creates from zooKeeperUrl, zooKeeperPassword and maximumConnectionTimeout. When not set, a CuratorFramework bean named curator in the registry is used, if there is one. The component does not close a client it did not create. The option is a org.apache.curator.framework.CuratorFramework type. | CuratorFramework | |
camel.component.zookeeper-master.enabled | Whether to enable auto configuration of the zookeeper-master component. This is enabled by default. | Boolean | |
camel.component.zookeeper-master.maximum-connection-timeout | The connection timeout, in milliseconds, of the CuratorFramework client that the component creates: how long a ZooKeeper operation waits for the connection to the ensemble before it fails with a connection loss. The session timeout is not set and stays at the Curator default (60 seconds). Not used when the curator option or a curator bean is used. | 10000 | Integer |
camel.component.zookeeper-master.zk-root | The ZooKeeper path under which each group has its znode (zkRoot/groupName). Each node of the group creates an ephemeral sequential znode below it, and the node with the lowest sequence number is the master. Missing parent znodes are created. | /camel/zookeepermaster/clusters/master | String |
camel.component.zookeeper-master.zoo-keeper-password | The password that the client authenticates to ZooKeeper with, using the digest scheme and the user name fabric (auth info fabric:password). When not set, the zookeeper.password system property is used. The znodes the component creates get the open ACL of Curator (world:anyone), so the password does not protect them. Not used when the curator option or a curator bean is used. | String | |
camel.component.zookeeper-master.zoo-keeper-url | The connect string of the ZooKeeper ensemble: a comma-separated list of host:port pairs, such as zk1:2181,zk2:2181,zk3:2181. When not set, the ZOOKEEPER_URL environment variable, then the ZK_CLIENT_SERVICE_HOST and ZK_CLIENT_SERVICE_PORT environment variables, then the zookeeper.url system property are used, and localhost:2181 at last. Not used when the curator option or a curator bean is used. | localhost:2181 | String |