With default configs Hazelcast run before Mongock. I use Hazelcast ITopic for prod/cons communications between microservices. But I receive data from the topic before the execution of the DB migration with Mongock. I have two solution in mind:
- waiting for Mongock event "SpringMigrationSuccessEvent" and then load manually Hazelcast, but I'm not able to found the right POM configs for event handling of Mongock and I'm not able to launch Hazelcast config programmatically.
- using CountDownLatch between the last Mongock's ChangeSet and the first message of Hazelcast Cons Itopic