lichuan6 opened a new issue #9186:
URL: https://github.com/apache/pulsar/issues/9186
Hi,
I'm writing a sink connector using `io.core.Sink`. However, when I tried to
call `record.getMessage()` and checked if message was present using
`msg.isPresent()`, I got a `false` value. Why I got a record with a mesage
whose publishtime and eventtime were both empty?
```java
@Override
public void write(Record<byte[]> record) {
Optional<Message<byte[]>> msg = record.getMessage();
Optional<Long> eventTime = record.getEventTime();
String t = "";
if (eventTime.isPresent()) {
t = eventTime.toString();
} else {
t = "Empty";
}
if (msg.isPresent()) {
System.out.println(">>>> PublishTime : " +
msg.get().getPublishTime() + ", Eventtime : " + t);
} else {
System.out.println(">>>> eventtime " + t + " Record(empty) :
"+record.toString() );
}
}
```
----------------------------------------------------------------
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]