BloomFilterIdempotencyChecker
class BloomFilterIdempotencyChecker(ttl: Duration, bloomFilterSupplier: () -> BloomFilter<String>) : IdempotencyChecker
Idempotency checker implementation using Bloom filters for efficient duplicate detection. Bloom filters provide probabilistic duplicate detection with configurable false positive rates, making them suitable for high-throughput scenarios where perfect accuracy is not required.
The checker automatically refreshes the Bloom filter based on the configured TTL, ensuring that old entries are periodically cleared to prevent memory leaks.
Note: Bloom filters can produce false positives (reporting an element as duplicate when it's not), but never false negatives (missing actual duplicates).
Author
ahoo wang
Parameters
ttl
the time-to-live duration for the Bloom filter before it gets refreshed
bloomFilterSupplier
supplier function that creates new Bloom filter instances