How to startup Hazelcast after Mongock migration?

92 Views Asked by At

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:

  1. 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.
  2. using CountDownLatch between the last Mongock's ChangeSet and the first message of Hazelcast Cons Itopic
1

There are 1 best solutions below

2
Mongock team On

I cannot tell you about Hazlecast configuration because I haven't worked with it, but I am aware it's a solid product and I bet it provides flexible configuration for its startup.

I think the first option is the way to go(I would totally discard the second one). Here there is an example of using Mongock's events.

I hope it helps. If you need any other help, let us know.