Integration / Apache Pulsar Interview questions
How does Pulsar achieve message deduplication?
Producer-side deduplication relies on each producer being assigned a unique producer name and tagging every message with a monotonically increasing sequence ID; the broker tracks the highest sequence ID it has durably stored per producer.
If a producer retries a publish (say, after a network timeout where it's unsure whether the original request succeeded), the broker recognizes the sequence ID as already seen and discards the duplicate rather than storing it again, while still acknowledging success back to the producer.
This must be explicitly enabled per namespace or topic since it adds tracking overhead, and it protects specifically against producer-retry duplicates, not against an application publishing the same logical event twice under different sequence IDs.
More Related questions...