Cancelling an Order

In this chapter, we cancel an order in Shopend with a topic, and we make sure that the refund is made exactly once, even when a service crashes or a message keeps failing.

After reading this chapter, you should be able to:

  • Design the cancellation of an order with a topic, and name its publisher and subscribers
  • Explain how the broker keeps a message until a consumer acknowledges it
  • Choose the broker’s time limit for an acknowledgment
  • Distinguish at-most-once and at-least-once delivery, and choose one for each of the cancellation’s queues
  • Design an idempotent consumer, including the idempotency key it sends to another system
  • Distinguish a failure that goes away from one that does not
  • Explain how a limit on deliveries and a dead-letter queue handle a message that keeps failing
  • Describe the transactional outbox, and explain why it delivers each message at least once
  • Explain why several instances and redelivery can handle messages in the wrong order, and design a consumer that handles them in any order

Sections

  1. Cancelling with a Topic
  2. When a Consumer Crashes
  3. Delivery Guarantees
  4. Refunding Once
  5. A Refund That Keeps Failing
  6. Saving and Publishing Together
  7. Message Order