Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

  1. Creation of nodes in any of the ZooKeeper create modes.
  2. Get and Set the data contents of arbitrary cluster nodes. (data being set must be convertable to byte[])
  3. Create and retrieve the list the child nodes attached to a particular node.
  4. A Distributed RoutePolicy that leverages a Leader election coordinated by ZooKeeper to determine if exchanges should get processed.

...

For flexibility, the endpoint allows the target znode to be specified dynamically as a message header. If a header keyed by the string 'CamelZooKeeperNode' is present then the value of the header will be used as the path to the znode on the server. For instance using the same route definition above, the following code snippet will write the data not to '/somepath/somenode' but to the path from the header '/somepath/someothernode'. Notice the testPayload must be convertable to byte[] as the data stored in ZooKeeper is byte based.

Code Block
java
java
ExchangeObject etestPayload = createExchangeWithBody(testPayload);...
template.sendBodyAndHeader("direct:write-to-znode", etestPayload, "CamelZooKeeperNode", "/somepath/someothernode");

...

or using the header 'CamelZookeeperCreateMode'Notice the testPayload must be convertable to byte[] as the data stored in ZooKeeper is byte based.

Code Block
java
java
ExchangeObject etestPayload = createExchangeWithBody(testPayload);...
template.sendBodyAndHeader("direct:create-and-write-to-persistent-znode", etestPayload, "CamelZooKeeperCreateMode", "PERSISTENT");

...