<properties>
<java.version>11</java.version>
+ <guava.version>30.0-jre</guava.version>
</properties>
<dependencies>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>${guava.version}</version>
+ </dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
package de.juplo.kafka.outbox;
+import com.google.common.primitives.Longs;
import org.apache.kafka.common.serialization.StringSerializer;
-import java.nio.ByteBuffer;
import java.time.Duration;
import java.util.List;
import java.util.Properties;
new ProducerRecord<>(topic, item.getKey(), item.getValue());
sequenceNumber = item.getSequenceNumber();
- ByteBuffer buffer = ByteBuffer.allocate(Long.BYTES);
- buffer.putLong(item.getSequenceNumber());
- record.headers().add("SEQ#", buffer.array());
+ record.headers().add("SEQ#", Longs.toByteArray(sequenceNumber));
producer.send(record, (metadata, e) ->
{