Addressing Idempotence Issues with Third Parties

The fake email service behaves in the way described above: when you ask it to crash, it’s configured to send an email first and then crash. If you navigate to its UI at http://localhost:3001/email/ui, you’ll see that there are multiple emails to the same person for the same order:

images/MultipleEmails.png

A screenshot of the fake email UI showing multiple emails sent to the same person for the same order.

This is harder to recover from: the part of our system that is told about email delivery is the part that’s failing. You can’t know if the email was sent—only the email service knows that. There are two common ways ...

Get Ruby on Rails Background Jobs with Sidekiq now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.