Examples of KafkaMessageStream


Examples of kafka.consumer.KafkaMessageStream

        // consumer with just one thread since the real parallelism is handled by Storm already
        Map<String, Integer> topicCountMap = new HashMap<String, Integer>();
        topicCountMap.put(topic, new Integer(1));

        Map<String, List<KafkaMessageStream>> consumerMap = consumerConnector.createMessageStreams(topicCountMap);
        KafkaMessageStream stream = consumerMap.get(topic).get(0);

        consumerIterator = stream.iterator();
    }
View Full Code Here

Examples of kafka.consumer.KafkaMessageStream

  public void run() {
    Map<String, Integer> topicCountMap = new HashMap<String, Integer>();
    topicCountMap.put(topic, new Integer(1));
    Map<String, List<KafkaMessageStream>> consumerMap = consumer.createMessageStreams(topicCountMap);
    KafkaMessageStream stream =  consumerMap.get(topic).get(0);
    ConsumerIterator it = stream.iterator();
    while(it.hasNext())
      System.out.println(ExampleUtils.getMessage(it.next()));
  }
View Full Code Here

Examples of kafka.consumer.KafkaMessageStream

  public void run() {
    Map<String, Integer> topicCountMap = new HashMap<String, Integer>();
    topicCountMap.put(topic, new Integer(1));
    Map<String, List<KafkaMessageStream>> consumerMap = consumer.createMessageStreams(topicCountMap);
    KafkaMessageStream stream =  consumerMap.get(topic).get(0);
    ConsumerIterator it = stream.iterator();
    while(it.hasNext())
      System.out.println(ExampleUtils.getMessage(it.next()));
  }
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.