I want to use Mongock migration tool to initialize my app's configuration that is stored in database. The problem I have is that one of my configs is used in class that is annotated with @Configuration. As Mongock changesets are executed after @Configuration it cannot retrieve not existing yet value from database and that results in a crash of application. Is there a way to postpone creating @Configuration class? Or should I initialize this one config without using mongock?
Asked
Active
Viewed 1,018 times
1 Answers
1
I don't fully understand your issue. I think that you need Mongock to run before your class annotated with @Configuration is processed. As you mention, SpringMongock requires the configuration class to be processed, as it requires the Spring ApplicationContext. However, you can run Mongock as standalone runner and use it(run it) wherever you want, as it doesn't depend on Spring context.
I hope it helps.

Mongock team
- 1,188
- 5
- 9