Identify previously acknowledged events in client app?

I’ve noticed that duplicate (those already acknowledged) events can be sent to a connected client on a restart of ES and subsequent reload of a competing consumer checkpoint.

Is is possible within the client to identify that the events has previously been sent and acknowledged?

Make them idempotent.

So an overview of our flow is:

  1. Voucher bought by a user
  2. VoucherPurchasedEvent saved to ES
  3. Subscription client receives the VoucherPurchasedEvent and sends an email/sms to the user to confirm purchase
    Sounds like our subscription client needs to be smarter and keep track of which events have already been handled such that duplicate email/sms messages are not sent.

What’s the difference between 1 & 2?
I would argue that if 2 hasn’t happened, 1 hasn’t happened.

Wouldn’t your subscription client already need to know it’s position in the stream?

You’re not going to be able to save the checkpoint atomically with sending the email, but measure the size of that risk and the impact of a duplicate email. Sounds minor to me.

Is is possible within the client to identify that the events has previously been sent and acknowledged?

Is this not just a special case of one of the fundamental problems of distributed systems? :wink:

"Sounds like our subscription client needs to be smarter and keep
track of which events have already been handled such that duplicate
email/sms messages are not sent."

This is "make them idempotent"

Greg