Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the early version of the new website
https://camel.apache.org/staging/
We would very much like to receive any feedback on the new site, please join the discussion on the Camel user mailing list.
Etcd ComponentAvailable since Camel 2.17.0 Etcd is a distributed key value store that provides a reliable way to store data across a cluster of machines. Maven users will need to add the following dependency to their <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-etcd</artifactId> <!-- use the same version as your Camel core version --> <version>x.y.z</version> </dependency> URI formatetcd:namespace[/path][?options] Where namespace represents the etcd context to which the etcd-component should operate and path is an optional attribute to define which node is being impacted. Supported namespaces are:
Options
Headers
Keys namespace example:
CamelContext context = new DefaultCamelContext(); context.addRoutes(new RouteBuilder() { public void configure() { from("direct:keys-set") .to("etcd:keys") .to("log:camel-etcd?level=INFO"); } }); Map<String, Object> headers = new HashMap<>(); headers.put(EtcdConstants.ETCD_ACTION, EtcdConstants.ETCD_KEYS_ACTION_SET); headers.put(EtcdConstants.ETCD_PATH, "/camel/etcd/myKey"); ProducerTemplate template = context.createProducerTemplate(); template.sendBodyAndHeaders("direct:keys-set", "camel-etcd", headers);
Stats namespace example:
CamelContext context = new DefaultCamelContext(); context.addRoutes(new RouteBuilder() { public void configure() { from("etcd:stats/leader?consumer.delay=50&consumer.initialDelay=0") .to("log:etcd-leader-stats?level=INFO"); from("etcd:stats/self?consumer.delay=50&consumer.initialDelay=0") .to("log:etcd-self-stats?level=INFO"); from("etcd:stats/store?consumer.delay=50&consumer.initialDelay=0") .to("log:etcd-store-stats?level=INFO"); } });
Watch namespace example:
CamelContext context = new DefaultCamelContext(); context.addRoutes(new RouteBuilder() { public void configure() { from("etcd:watch/recursive?recursive=true") .marshall().json() .to("log:etcd-event?level=INFO") } });
|