message listeners should store the ids of events they've processed

After an event listener or command listener has successfully processed an event from a Message broker, it should store the id of the event in a data store.

This way, if they need to re-process a broker topic (e.g. to process message types they skipped before[1]), they can skip events which have already been processed.

However: if the event listener processes a great deal of events, you may not want to store them after a period of time. You have to weigh the storage cost vs potential need to reprocess.[2]


  1. You could instead make it a policy to always process all event types on a topic, but that has its own downsides: you're storing data you may never care about, and more importantly you aren't able to make incremental changes (eat an elephant one bite at a time) ↩︎

  2. You could also add logic to say "this is a create, I already have the entity, don't process", but that could ignore legitimate errors ↩︎