Skip to main content

~/discoveries

[snippet]

Kafka tombstones via console producer

Key + null value = tombstone. Use null.marker so the CLI can send it.

bin/kafka-console-producer.sh --bootstrap-server localhost:9092 \
  --topic my-compacted-topic \
  --property parse.key=true \
  --property key.separator=: \
  --property null.marker=NULL

# Then type: user123:NULL

Compacted topics need a null value to delete a key. The console producer’s null.marker makes that one line instead of a custom producer.