Examples of ConsumerConfig


Examples of kafka.consumer.ConsumerConfig

        props.put("group.id", KafkaConstants.DEFAULT_GROUP);
        props.put("zookeeper.session.timeout.ms", "400");
        props.put("zookeeper.sync.time.ms", "200");
        props.put("auto.commit.interval.ms", "1000");

        kafkaConsumer = kafka.consumer.Consumer.createJavaConsumerConnector(new ConsumerConfig(props));
    }
View Full Code Here

Examples of kafka.consumer.ConsumerConfig

    @Override
    protected void doStart() throws Exception {
        super.doStart();
        log.info("Starting Kafka consumer");

        consumer = kafka.consumer.Consumer.createJavaConsumerConnector(new ConsumerConfig(getProps()));

        Map<String, Integer> topicCountMap = new HashMap<String, Integer>();
        topicCountMap.put(endpoint.getTopic(), endpoint.getConsumerStreams());
        Map<String, List<KafkaStream<byte[], byte[]>>> consumerMap = consumer.createMessageStreams(topicCountMap);
        List<KafkaStream<byte[], byte[]>> streams = consumerMap.get(endpoint.getTopic());
View Full Code Here

Examples of kafka.consumer.ConsumerConfig

                                            newDimExclus
                                        )
                      )
    );

    final ConsumerConnector connector = Consumer.createJavaConsumerConnector(new ConsumerConfig(consumerProps));

    final Map<String, List<KafkaStream<Message>>> streams = connector.createMessageStreams(ImmutableMap.of(feed, 1));

    final List<KafkaStream<Message>> streamList = streams.get(feed);
    if (streamList == null || streamList.size() != 1) {
View Full Code Here

Examples of kafka.consumer.ConsumerConfig

        props.setProperty("consumer.timeout.ms",
                String.valueOf(configuration.getTimeout().toMilliseconds()));
        props.setProperty("rebalance.retries.max",
                String.valueOf(configuration.getRebalanceRetries()));

        return new ConsumerConfig(props);
    }
View Full Code Here

Examples of kafka.consumer.ConsumerConfig

        props.setProperty("consumer.timeout.ms",
                String.valueOf(configuration.getTimeout().toMilliseconds()));
        props.setProperty("rebalance.retries.max",
                String.valueOf(configuration.getRebalanceRetries()));

        return new ConsumerConfig(props);
    }
View Full Code Here

Examples of kafka.consumer.ConsumerConfig

  public void init() {
    // Clear the list of threads.
    _kafkaMessageProcessorThreadList.clear();

    // Create the Kafka consumer config.
    final ConsumerConfig kafkaConsumerConfig = new ConsumerConfig(
        getProperties());

    // Connect to Kafka via the high-level consumer API.
    _consumer = kafka.consumer.Consumer
        .createJavaConsumerConnector(kafkaConsumerConfig);
View Full Code Here

Examples of kafka.consumer.ConsumerConfig

            consumer_props.put("zookeeper.session.timeout.ms", server_props.getProperty("zookeeper.session.timeout.ms", "6000"));
            consumer_props.put("zookeeper.connection.timeout.ms", server_props.getProperty("zookeeper.connection.timeout.ms", "6000"));
            consumer_props.put("zookeeper.sync.time.ms", server_props.getProperty("zookeeper.sync.time.ms", "2000"));

            // Setup consumer
            consumer = Consumer.createJavaConsumerConnector(new ConsumerConfig(consumer_props));
            Map<String, Integer> topicCountMap = new HashMap<String, Integer>();
            topicCountMap.put(metrics_topic, 1);

            Map<String, List<KafkaStream<byte[], byte[]>>> consumerMap = consumer.createMessageStreams(topicCountMap);
View Full Code Here

Examples of kafka.consumer.ConsumerConfig

        props.setProperty("consumer.timeout.ms",
                String.valueOf(factory.getTimeout().toMilliseconds()));
        props.setProperty("rebalance.retries.max",
                String.valueOf(factory.getRebalanceRetries()));

        return new ConsumerConfig(props);
    }
View Full Code Here

Examples of kafka.consumer.ConsumerConfig

        props.setProperty("consumer.timeout.ms",
                String.valueOf(factory.getTimeout().toMilliseconds()));
        props.setProperty("rebalance.max.retries",
                String.valueOf(factory.getRebalanceRetries()));

        return new ConsumerConfig(props);
    }
View Full Code Here

Examples of kafka.consumer.ConsumerConfig

  public void run(){
    status=WorkerThreadStatus.INIT;
    props = new Properties();
    props.put("groupid", workload.consumerGroup);
    props.put("zk.connect", workload.zkConnect);
    config = new ConsumerConfig(props);
    consumerConnector = Consumer.createJavaConsumerConnector(config);
   
    try {
      handler = (MessageHandler) new ICURLClassLoader().getClassLoader(workload)
              .loadClass(this.workload.messageHandlerName).newInstance();
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.