ivankelly commented on a change in pull request #3462: Added suppport for Kafka 
partitioner and explicit setting of partition on record
URL: https://github.com/apache/pulsar/pull/3462#discussion_r252666440
 
 

 ##########
 File path: 
pulsar-client-kafka-compat/pulsar-client-kafka/src/main/java/org/apache/kafka/clients/producer/PulsarKafkaProducer.java
 ##########
 @@ -232,12 +243,11 @@ public void close(long timeout, TimeUnit unit) {
     }
 
     private int buildMessage(TypedMessageBuilder<byte[]> builder, 
ProducerRecord<K, V> record) {
-        if (record.partition() != null) {
-            throw new UnsupportedOperationException("");
-        }
-
+        byte[] keyBytes = null;
         if (record.key() != null) {
-            builder.key(getKey(record.topic(), record.key()));
+            String key = getKey(record.topic(), record.key());
+            keyBytes = key.getBytes();
 
 Review comment:
   Add UTF_8

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to