architecture – Eventing: Determine if Set of Messages has been Processed

Given a Set of messages sent to a Queue, what are good ways to determine all of the messages have been processed?


  • Large number of messages
  • Other messages besides those in the Set will be in the queue (queue size may never be 0)
  • Queue does not guarantee ordering of messages

The best solution I have thought of so far is: give each message a GUID, when posting message to the Queue also add an entry to an “Unprocessed” table with the GUID key and a “SetId” column. When the message is processed, delete the “Unprocessed” table entry for that GUID. Query if all messages have been processed by “Any(unprocessed where SetId={id})”.

The reason I am asking is for the following workflow: the user triggers an automation, which itself triggers numerous events for actions to perform on the system, and then we want to display to the user whether the automation has completed. Backend microservice system. Open to alternative techniques besides the general problem I proposed as well. I am also open to suggestions like: choose a different queue that enforces ordering, if that is a practical solution you would use.