Browse Source

kafka-933; Hadoop example running DataGenerator causes kafka.message.Message cannot be cast to [B exception; patched by drunkedcat; reviewed by Jun Rao

pull/15/head
drunkedcat 11 years ago committed by Jun Rao
parent
commit
99dd94c9b6
  1. 3
      contrib/hadoop-consumer/src/main/java/kafka/etl/impl/DataGenerator.java

3
contrib/hadoop-consumer/src/main/java/kafka/etl/impl/DataGenerator.java

@ -86,8 +86,7 @@ public class DataGenerator { @@ -86,8 +86,7 @@ public class DataGenerator {
Long timestamp = RANDOM.nextLong();
if (timestamp < 0) timestamp = -timestamp;
byte[] bytes = timestamp.toString().getBytes("UTF8");
Message message = new Message(bytes);
list.add(new KeyedMessage<Integer, Message>(_topic, null, message));
list.add(new KeyedMessage<Integer, byte[]>(_topic, null, bytes));
}
// send events
System.out.println(" send " + list.size() + " " + _topic + " count events to " + _uri);

Loading…
Cancel
Save