A deduplicator, that assumes steadily increasing global sequnece numbers
[demos/kafka/deduplication] / src / main / java / de / juplo / demo / kafka / deduplication / SequenceNumberExtractor.java
1 package de.juplo.demo.kafka.deduplication;
2
3 import org.apache.kafka.common.header.Headers;
4
5
6 public interface SequenceNumberExtractor<K,V>
7 {
8   /**
9    * Extracts a sequence number from the given value.
10    *
11    * The sequence number must be represented as a {@link Long} value.
12    *
13    * @param topic The topic, the message was issued on
14    * @param partition The partition, the message was written to
15    * @param offset The offset of the message in the partition
16    * @param key The key of the message
17    * @param value The value of the message
18    * @return a unique ID
19    */
20   public long extract(String topic, int partition, long offset, Headers headers, K key, V value);
21 }