You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/04/10 00:11:08 UTC

[GitHub] [pulsar-adapters] dlg99 commented on a change in pull request #10: Feature: Run Kafka streams app with Pulsar

dlg99 commented on a change in pull request #10:
URL: https://github.com/apache/pulsar-adapters/pull/10#discussion_r610958065



##########
File path: pulsar-client-kafka-compat/pulsar-client-kafka/src/main/java/org/apache/kafka/clients/producer/PulsarKafkaProducer.java
##########
@@ -366,7 +372,15 @@ private RecordMetadata getRecordMetadata(String topic, TypedMessageBuilder<byte[
 
         TopicPartition tp = new TopicPartition(topic, partition);
         TypedMessageBuilderImpl<byte[]> mb = (TypedMessageBuilderImpl<byte[]>) msgBuilder;
-        return new RecordMetadata(tp, offset, 0L, mb.getPublishTime(), 0L, mb.hasKey() ? mb.getKey().length() : 0, size);
+
+        long publishTime = 0L;
+        try {
+            // there is no hasPublishTime() currently
+            publishTime = mb.getPublishTime();
+        } catch (IllegalStateException ise) {
+            logger.debug("could not get publish time");

Review comment:
       all messages that passed through LIneSplit example had this problem. 
   Error logging was too noisy.
   I didn't have time to investigate where it is expected to be filled in / why it was blank.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org