Examples of KafkaServerStartable


Examples of kafka.server.KafkaServerStartable

    zookeeper = new KafkaSourceEmbeddedZookeeper(zkPort);
    Properties props = new Properties();
    props.put("zookeeper.connect",zookeeper.getConnectString());
    props.put("broker.id","1");
    KafkaConfig config = new KafkaConfig(props);
    kafkaServer = new KafkaServerStartable(config);
    kafkaServer.startup();
    initProducer();
  }
View Full Code Here

Examples of kafka.server.KafkaServerStartable

            zookeeper = CuratorFrameworkFactory.newClient(zookeeperConnectionString, retryPolicy);
            zookeeper.start();
            port = InstanceSpec.getRandomPort();
            logDir = new File(System.getProperty("java.io.tmpdir"), "kafka/logs/kafka-test-" + port);
            KafkaConfig config = buildKafkaConfig(zookeeperConnectionString);
            kafka = new KafkaServerStartable(config);
            kafka.startup();
        } catch (Exception ex) {
            throw new RuntimeException("Could not start test broker", ex);
        }
    }
View Full Code Here

Examples of kafka.server.KafkaServerStartable

            ExponentialBackoffRetry retryPolicy = new ExponentialBackoffRetry(1000, 3);
            zookeeper = CuratorFrameworkFactory.newClient(zookeeperConnectionString, retryPolicy);
            zookeeper.start();
            port = InstanceSpec.getRandomPort();
            kafka.server.KafkaConfig config = buildKafkaConfig(zookeeperConnectionString);
            kafka = new KafkaServerStartable(config);
            kafka.startup();
        } catch (Exception ex) {
            throw new RuntimeException("Could not start test broker", ex);
        }
    }
View Full Code Here

Examples of kafka.server.KafkaServerStartable

    public KafkaLocal(Properties kafkaProperties) throws IOException,
        InterruptedException{
        KafkaConfig kafkaConfig = new KafkaConfig(kafkaProperties);

        //start local kafka broker
        kafka = new KafkaServerStartable(kafkaConfig);
    }
View Full Code Here

Examples of kafka.server.KafkaServerStartable

        props.put("port", "9092");
        props.put("broker.id", "1");
        props.put("log.dir", logDir);
        props.put("zookeeper.connect",zkConnect);
        KafkaConfig kafkaConfig = new KafkaConfig(props);
        KafkaServerStartable server = new KafkaServerStartable(kafkaConfig);
        server.startup();
        return server;
    }
View Full Code Here

Examples of kafka.server.KafkaServerStartable

public final class EmbeddedKafkaServer extends AbstractIdleService {

  private final KafkaServerStartable server;

  public EmbeddedKafkaServer(Properties properties) {
    server = new KafkaServerStartable(new KafkaConfig(properties));
  }
View Full Code Here

Examples of kafka.server.KafkaServerStartable

    properties.setProperty("broker.id", Integer.toString(TEST_BROKER_ID));
    properties.setProperty("log.dirs", logsDir.toAbsolutePath().toString());
    properties.setProperty("port", Integer.toString(port));
    properties.setProperty("zookeeper.connect", "localhost:" + zkPort);

    kafkaServer = new KafkaServerStartable(new KafkaConfig(properties));
    kafkaServer.startup();
  }
View Full Code Here

Examples of kafka.server.KafkaServerStartable

        } catch (Exception e) {
            throw new IllegalStateException(e);
        }
        KafkaConfig config = getKafkaConfig(zkServer.getConnectString());
        kafkaServer = new KafkaServerStartable(config);
        kafkaServer.startup();
    }
View Full Code Here

Examples of kafka.server.KafkaServerStartable

                .put("zookeeper.connect", zookeeper.getConnectString())
                .putAll(Maps.fromProperties(overrideProperties))
                .build();

        KafkaConfig config = new KafkaConfig(toProperties(properties));
        this.kafka = new KafkaServerStartable(config);
    }
View Full Code Here

Examples of kafka.server.KafkaServerStartable

            Properties p = new Properties();
            p.setProperty("zookeeper.connect", zookeeperConnectionString);
            p.setProperty("broker.id", "0");
            p.setProperty("port", "" + port);
            kafka.server.KafkaConfig config = new kafka.server.KafkaConfig(p);
            kafka = new KafkaServerStartable(config);
            kafka.startup();
        } catch (Exception ex) {
            throw new RuntimeException("Could not start test broker", ex);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.