Global task listener gets called before task is persistent

Hi,

I see three options:

  1. You configure rabbitmq and Camunda such that they share a transaction, so the message only shows up in the queue as soon as the overall transaction is committed. This would make both actions essentially atomic, eliminating a couple of other error sources (e.g. what if the message gets published but the Camunda transaction rolls back?).
  2. You implement retries in the code that reacts to the message.
  3. You implement a transaction listener as outlined here: Why can't I see the end event during a process instance end event listener?. This allows you to run code when the Camunda transaction has been committed. It is internal API and therefore not guaranteed to be stable.

Cheers,
Thorben