MCPcopy Create free account
hub / github.com/apache/kafka / run

Method run

examples/src/main/java/kafka/examples/Consumer.java:55–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53 }
54
55 public void run() {
56 Map<String, Integer> topicCountMap = new HashMap<String, Integer>();
57 topicCountMap.put(topic, new Integer(1));
58 Map<String, List<KafkaStream<byte[], byte[]>>> consumerMap = consumer.createMessageStreams(topicCountMap);
59 KafkaStream<byte[], byte[]> stream = consumerMap.get(topic).get(0);
60 ConsumerIterator<byte[], byte[]> it = stream.iterator();
61 while(it.hasNext())
62 System.out.println(new String(it.next().message()));
63 }
64}

Callers

nothing calls this directly

Calls 6

createMessageStreamsMethod · 0.80
iteratorMethod · 0.80
hasNextMethod · 0.80
putMethod · 0.45
getMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected