use of kafka.server.KafkaServerStartable in project beam by apache.
the class EmbeddedKafkaCluster method startup.
public void startup() {
for (int i = 0; i < ports.size(); i++) {
Integer port = ports.get(i);
File logDir = TestUtils.constructTempDir("kafka-local");
Properties properties = new Properties();
properties.putAll(baseProperties);
properties.setProperty("zookeeper.connect", zkConnection);
properties.setProperty("broker.id", String.valueOf(i + 1));
properties.setProperty("advertised.host.name", "127.0.0.1");
properties.setProperty("host.name", "127.0.0.1");
properties.setProperty("advertised.port", Integer.toString(port));
properties.setProperty("port", Integer.toString(port));
properties.setProperty("log.dirs", logDir.getAbsolutePath());
properties.setProperty("offsets.topic.num.partitions", "1");
properties.setProperty("offsets.topic.replication.factor", "1");
properties.setProperty("log.flush.interval.messages", String.valueOf(1));
KafkaServerStartable broker = startBroker(properties);
brokers.add(broker);
logDirs.add(logDir);
}
}
use of kafka.server.KafkaServerStartable in project beam by apache.
the class EmbeddedKafkaCluster method startBroker.
private static KafkaServerStartable startBroker(Properties props) {
KafkaServerStartable server = new KafkaServerStartable(new KafkaConfig(props));
server.startup();
return server;
}
Aggregations