Search in sources :

Example 1 with RetryNTimes

use of com.netflix.curator.retry.RetryNTimes in project elasticsearch-river-kafka by endgameinc.

the class KafkaClient method connect.

void connect(String zk, String broker, int port) {
    try {
        consumer = new SimpleConsumer(broker, port, 1000, 1024 * 1024 * 10);
        curator = CuratorFrameworkFactory.newClient(zk, 1000, 15000, new RetryNTimes(5, 2000));
        curator.start();
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : RetryNTimes(com.netflix.curator.retry.RetryNTimes) SimpleConsumer(kafka.javaapi.consumer.SimpleConsumer)

Example 2 with RetryNTimes

use of com.netflix.curator.retry.RetryNTimes in project storm-signals by ptgoetz.

the class StandaloneSignalConnection method init.

public void init() throws Exception {
    this.client = CuratorFrameworkFactory.builder().namespace(namespace).connectString(connectString).retryPolicy(new RetryNTimes(this.zkRetries, this.zkRetryInterval)).build();
    this.client.start();
    super.initWatcher();
}
Also used : RetryNTimes(com.netflix.curator.retry.RetryNTimes)

Example 3 with RetryNTimes

use of com.netflix.curator.retry.RetryNTimes in project storm-signals by ptgoetz.

the class StormSignalConnection method init.

@SuppressWarnings("rawtypes")
public void init(Map conf) throws Exception {
    String connectString = zkHosts(conf);
    int retryCount = Utils.getInt(conf.get("storm.zookeeper.retry.times"));
    int retryInterval = Utils.getInt(conf.get("storm.zookeeper.retry.interval"));
    this.client = CuratorFrameworkFactory.builder().namespace(namespace).connectString(connectString).retryPolicy(new RetryNTimes(retryCount, retryInterval)).build();
    this.client.start();
    super.initWatcher();
}
Also used : RetryNTimes(com.netflix.curator.retry.RetryNTimes)

Aggregations

RetryNTimes (com.netflix.curator.retry.RetryNTimes)3 SimpleConsumer (kafka.javaapi.consumer.SimpleConsumer)1