Package kafka.consumer

Examples of kafka.consumer.ConsumerIterator


  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


  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

Related Classes of kafka.consumer.ConsumerIterator

Copyright © 2018 www.massapicom. 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.