Examples of KafkaConfig


Examples of com.rackspacecloud.blueflood.service.KafkaConfig

    private final String eventName = RollupEventEmitter.ROLLUP_EVENT_NAME;
    private Random rand = new Random();

    private void init() throws Exception {
        try {
            KafkaConfig config = new KafkaConfig();
            if(config.getBooleanProperty("blueflood.enable.kafka.service")) {
                numberOfProducers = config.getIntegerProperty("blueflood.producer.count") != null ? config.getIntegerProperty("blueflood.producer.count") : DEFAULT_KAFKA_PRODUCERS;
                kafkaExecutors = new ThreadPoolBuilder()
                        .withCorePoolSize(numberOfProducers)
                        .withMaxPoolSize(numberOfProducers)
                        .withUnboundedQueue()
                        .build();
                for(int i=0;i<numberOfProducers;i++) {
                    Producer producer = new Producer(new ProducerConfig(config.getKafkaProperties()));
                    producerList.add(producer);
                }
                ready = true;
            }
        } catch (Exception e) {
View Full Code Here

Examples of kafka.server.KafkaConfig

  public KafkaSourceEmbeddedKafka() {
    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.KafkaConfig

            ExponentialBackoffRetry retryPolicy = new ExponentialBackoffRetry(1000, 3);
            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.KafkaConfig

        Properties p = new Properties();
        p.setProperty("zookeeper.connect", zookeeperConnectionString);
        p.setProperty("broker.id", "0");
        p.setProperty("port", "" + port);
        p.setProperty("log.dirs", logDir.getAbsolutePath());
        return new KafkaConfig(p);
    }
View Full Code Here

Examples of kafka.server.KafkaConfig

        Properties p = new Properties();
        p.setProperty("zookeeper.connect", zookeeperConnectionString);
        p.setProperty("broker.id", "0");
        p.setProperty("port", "" + port);
        p.setProperty("log.dirs", getLogDir());
        return new KafkaConfig(p);
    }
View Full Code Here

Examples of kafka.server.KafkaConfig

    public KafkaServerStartable kafka;
    public ZooKeeperLocal zookeeper;

    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.KafkaConfig

        Properties props = new Properties();
        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.KafkaConfig

   */
  public static final KafkaServerRunnable newInstance(String kafkaConfigFile,
      boolean addShutdownHook) {

    // Parse the config from file.
    final KafkaConfig kafkaConfig = new KafkaConfig(
        kafka.utils.Utils.loadProps(kafkaConfigFile));

    return newInstance(kafkaConfig, addShutdownHook);
  }
View Full Code Here

Examples of kafka.server.KafkaConfig

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.KafkaConfig

    brokerProps.setProperty("log.dir", "/tmp/ks1logdir");

    File f = new File ("/tmp/ks1logdir");
    EmbeddedZookeeper.delete(f);

    config = new KafkaConfig(brokerProps);

    producer = new Producer<Integer,String>(producerConfig);

    if ( server == null ) {
      server = new kafka.server.KafkaServer(config);
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.