eolivelli commented on a change in pull request #10:
URL: https://github.com/apache/pulsar-adapters/pull/10#discussion_r611009051
##########
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:
@dlg99 good point. +1
--
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:
[email protected]