openrm / hato

A minimalist, customizeable AMQP framework in Node.js
MIT License
1 stars 0 forks source link

Reorganize error handling in rpc/retry plugins #37

Closed naggingant closed 4 years ago

naggingant commented 4 years ago

Background

As plugins needed to ensure acknowledgements of certain messages (e.g. ack'ing after a retry message is dispatched) there had to be some mechanisms to centralize the state of acknowledgement to also accept them from users. In addition, there is a case where a plugin handler acting depending on the user acknowledgements (e.g. the retry plugin should not do so when the message is negatively acknowledged)

This finally led to the ack state object who ensures ack's of only one time, and also remembers the first (effective) acknowledgement.

naggingant commented 4 years ago

Updated the description to give more detailed background. I hope it's not too poor.