All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.keyko.monitoring.time.EventBlockTimestampExtractor Maven / Gradle / Ivy

package io.keyko.monitoring.time;

import io.keyko.monitoring.schemas.EventBlockRecord;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.streams.processor.TimestampExtractor;

public class EventBlockTimestampExtractor implements TimestampExtractor {
  @Override
  public long extract(ConsumerRecord record, long previousTimestamp) {

    if (record != null && record.value() != null) {

      if (record.value() instanceof EventBlockRecord) {
        return ((EventBlockRecord) record.value()).getBlock().getTimestamp();
      }

    }
    return record.timestamp();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy