Replies: 0 comments 6 replies
-
|
Hello, @rfelgent. Sorry for the delay, promise I thought I had have answered already. Anyway, I understand you basically want to run Mongock on demand at any time during the application lifecycle. I Although Mongock doesn't provide an explicit mechanism for this, you could have some workaround. The ideal scenario(which it's not possible right now and I explain later why), is you creating a MongockRunner bean and run it when you wish. As I said this is not currently possible. The only thing stoping you from this approach is that the Mongock driver can be only used once(this seemed a good idea back in time, but we are re-considering it). So the closest approach is creating a MongockBuilder bean and every time you want to run Mongock, construct the ConnectionDriver , inject it to the builder, build the runner and execute it. If you are considering adding this, it's important for your project and you need help, lets us know and we can help :) |
Beta Was this translation helpful? Give feedback.
-
|
I second @rfelgent's request. I've got some complicated integrations tests to write. Being able to run Mongock programatically would make setup so much easier. |
Beta Was this translation helpful? Give feedback.
-
|
I am also looking for something similar. Appreciate if examples can be provided. Can we run one time job with one file injected programmatically without scanning the whole package? |
Beta Was this translation helpful? Give feedback.
-
|
@dieppa thanks for quick response, appreciate that. I am referring to the same already but there is no config using which i can set only one file. Config is to scan package. I am looking for setting a file and invoking all change sets of that Migration file. FYI: I am trying to migrate my project from mongobee to mongock library. Using mongobee we were using changeset method and invoking that. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @ll,
it would be convinient if there is a programmatic approach to "trigger" mongock's changelog/changeunit processing (several times) at runtime.
Currently, this logic is somewhat "restricted" to the application bootstrapping (either during bean initialization or after application startup).
The reason behind this is, that my app creates collections at runtime depending on incoming data. After the collection gets created, I would like to "trigger" mongock but haven't found a nice way yet. I do not require to trigger a specific changeunit - just the default mongock logic similar during application startup
Best regards!
Beta Was this translation helpful? Give feedback.
All reactions