Browse Source

trivial change to add byte serializer to ProducerPerformance; patched by Jun Rao

pull/38/merge
Jun Rao 10 years ago
parent
commit
bfb2da3c82
  1. 7
      clients/src/main/java/org/apache/kafka/clients/tools/ProducerPerformance.java

7
clients/src/main/java/org/apache/kafka/clients/tools/ProducerPerformance.java

@ -15,10 +15,7 @@ package org.apache.kafka.clients.tools; @@ -15,10 +15,7 @@ package org.apache.kafka.clients.tools;
import java.util.Arrays;
import java.util.Properties;
import org.apache.kafka.clients.producer.Callback;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.clients.producer.RecordMetadata;
import org.apache.kafka.clients.producer.*;
public class ProducerPerformance {
@ -46,6 +43,8 @@ public class ProducerPerformance { @@ -46,6 +43,8 @@ public class ProducerPerformance {
throw new IllegalArgumentException("Invalid property: " + args[i]);
props.put(pieces[0], pieces[1]);
}
props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.ByteArraySerializer");
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.ByteArraySerializer");
KafkaProducer<byte[], byte[]> producer = new KafkaProducer<byte[],byte[]>(props);
/* setup perf test */

Loading…
Cancel
Save