Event publishing delay


In my scenario domain receives commands through Process Manager and persists events in ES. Process manager also coordinates instructions for legacy system integration (ACL). In this scenario, our goal is to publish domain events into enterprise bus only when the whole process completes - domain operations executed, ACL is in sync.

This results in domain event publishing delay problem. For now i’m considering to delegate this task to process manager - publish domain events only when all workflow is completed (pull events from ES and push them into event bus). However this still bugs me, because I’m not sure if this is really good idea.

Can anyone comment such design and it’s possible pitfalls?

Hi Raimondas,

Instead, Process Manager could send a special command to an aggregate after and ACL sync is done, and then aggregate will publish an event.