use of org.apache.camel.component.zookeeper.operations.GetChildrenOperation in project camel by apache.
the class ZooKeeperProducerTest method setUsingCreateModeFromHeader.
@Test
public void setUsingCreateModeFromHeader() throws Exception {
client.createPersistent("/modes-test", "parent for modes");
for (CreateMode mode : CreateMode.values()) {
Exchange exchange = createExchangeWithBody(testPayload);
exchange.getIn().setHeader(ZOOKEEPER_CREATE_MODE, mode);
exchange.getIn().setHeader(ZOOKEEPER_NODE, "/modes-test/" + mode);
exchange.setPattern(ExchangePattern.InOut);
template.send("direct:node-from-header", exchange);
}
GetChildrenOperation listing = new GetChildrenOperation(getConnection(), "/modes-test");
assertEquals(CreateMode.values().length, listing.get().getResult().size());
}
use of org.apache.camel.component.zookeeper.operations.GetChildrenOperation in project camel by apache.
the class ZooKeeperConsumer method addBasicChildListingSequence.
private void addBasicChildListingSequence(String node) {
operations.clear();
operations.add(new AnyOfOperations(node, new ExistsOperation(connection, node), new ExistenceChangedOperation(connection, node)));
operations.add(new GetChildrenOperation(connection, node));
operations.add(new ChildrenChangedOperation(connection, node, false));
}
Aggregations