use of kafka.server.KafkaServerStartable in project pinpoint by naver.
the class KafkaUnitServer method startup.
public void startup() {
zookeeper = new ZookeeperUnitServer(zkPort, zkMaxConnections);
zookeeper.startup();
try {
logDir = Files.createTempDirectory("kafka").toFile();
} catch (IOException e) {
throw new RuntimeException("Unable to start Kafka", e);
}
logDir.deleteOnExit();
Runtime.getRuntime().addShutdownHook(new Thread(getDeleteLogDirectoryAction()));
kafkaBrokerConfig.setProperty("zookeeper.connect", zookeeperString);
kafkaBrokerConfig.setProperty("broker.id", "1");
kafkaBrokerConfig.setProperty("host.name", "localhost");
kafkaBrokerConfig.setProperty("port", Integer.toString(brokerPort));
kafkaBrokerConfig.setProperty("log.dir", logDir.getAbsolutePath());
kafkaBrokerConfig.setProperty("log.flush.interval.messages", String.valueOf(1));
kafkaBrokerConfig.setProperty("delete.topic.enable", String.valueOf(true));
kafkaBrokerConfig.setProperty("offsets.topic.replication.factor", String.valueOf(1));
kafkaBrokerConfig.setProperty("auto.create.topics.enable", String.valueOf(true));
broker = new KafkaServerStartable(new KafkaConfig(kafkaBrokerConfig));
broker.startup();
}
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