Recently my team has inherited a code-base with an interesting problem.
The system keeps historical records by having multiple listeners on the same event. These listeners execute serially, so if we have listener A, B, and C, B would wait for A to finish first before C and so-on.
Each listener updates a separate table.
However, if the system goes down while we're attempting to write B, then the tables in A, B, and C will come out of sync.
Is there a good solution for getting a transactional write for these listeners without coupling the listeners together?