The goal is to remove the drawback of the current impl:
- when audit backend is down or throttling the queue can not be flushed, postcommit listener wait and creates new threads without limits
- as postcommit listener events are reconnected
So a better impl will be to do as in ES indexing: :
- use a sync listener to stack audit entries
- use a synchronization (afterCompletion) to flush audit entries
This task can be merged with NXP-22109 so instead of flushing to an ES backend we flush it to a mqueue that is processed by a computation.