0

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
tommynicoletti
  • 140
  • 1
  • 6

1 Answers1

1

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.

Mongock team
  • 1,188
  • 5
  • 9
  • Thanks!!! now I'm able to handle "SpringMigrationSuccessEvent" correctly, according to the right versions on POM (actually mongock 5.0.1.BETA in my project) found in the example (I changed from "mongock-spring-v5" to "mongock-springboot-v2.4"). Looking for manual Hazelcast sturtup now. – tommynicoletti May 03 '21 at 11:13
  • Well, that's a beta. If you are in production I suggest you to use the last stable version, 4.3.8. It won't change the way to handle events ;) – Mongock team May 03 '21 at 13:09