Pub/Sub: Idempotent subscribers without hand-rolling it #18017
violetta98
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello everyone!
I got tired of rewriting duplicate handling in every subscriber, so I packaged it. Pub/Sub is at-least-once and the docs say to handle duplicates without saying how.
Dedup is on the Pub/Sub
message_id. A duplicate arriving while the first is still running waits and gets the same result.One thing worth knowing either way: if your callback takes longer than the ack deadline, Pub/Sub sends the message again while the first one is still running. That's where most "why did this happen twice" reports come from.
https://github.com/idemkit/idemkit, Apache-2.0
If it's useful, I'd appreciate a star. It's new, so visibility helps a lot right now.
All reactions