Comments (4)
Hello @thorstenvogel ,
can you tell me which version are you using, please?
from mongock.
Hi @dieppa, using latest and greatest 5.3.4 :)
I managed to get it to work by defining my own MongockApplicationRunner
using MongockSpringboot.builder()
and registering the dependencies manually by name.
So i am missing out of the configuration magic that @EnableMongock
provides.
My goal was to inject dependencies via their name into ChangeUnits - and i couldn't figure out another way.
EDIT:
My approach does not work, so the question remains.
from mongock.
I managed to inject my named beans into ChangeUnit-Methods via
@Execution
public void migrateSomething(@NonLockGuarded
@Named("namedBean")
MyBean namedBean) {
// do something with namedBean
}
The injection mechanism in Mongock does not allow fields to be injected into the class as constructor-parameter as far as i can see.
For the future ist would be great if ChangeUnits could just be Spring beans, utilizing the dependency-injection mechanisms of Spring.
from mongock.
Hello, I didn't answer until now as we have been pretty busy and I saw you managed to make it work.
Your suggestion is very interesting, but represents important challenges, specially because Mongock proxies the injection for distributed synchronisation's sake.
On the other hand, I don't think it's that far. As long as I remember, springboot supports @Named
injections and Mongock should support dependency injection as construction time.
Thanks!
from mongock.
Related Issues (20)
- Migrations are not applied to DB. Also there is no logs related to mongock while running application HOT 1
- retryable writes error for mongock-examples/mongodb/standalone-reactive/ example HOT 1
- ClassCastException after upgrading from Mongock 4.1.14 to 5.2.4 HOT 6
- Clarify ordering mechanism in docs HOT 5
- upgrade guava to 32.0.0-jre to fix CVE-2020-8908 and CVE-2023-2976 HOT 2
- Support for Elasticsearch with an Elasticsearch driver HOT 1
- Change Unit is not working with spring boots's annotation @CompoundIndex on entity class HOT 5
- default-migration-author not applied in spring context HOT 2
- business related questions HOT 6
- Unable to specify/override ReadConcern for transactional ChangeUnits HOT 1
- Mongock migration for MongoDB on CosmosDB fails HOT 2
- @ChangeSet executed before @ChangeUnit, ignoring order HOT 3
- MongoCK ChangeUnit doesn't auto wire other spring beans as dependency HOT 3
- Not supporting @ConditionalOnExpression or @ConditionalOnProperty HOT 2
- ChangeUnits containing Unnamed Variables (JEP443) are not found by Mongock. HOT 7
- Configuration error when using multiple transaction managers HOT 1
- BOM not published for version 5.3.5 HOT 2
- State that the order of a ChangeUnit is alphabetically (documentation/website issue) HOT 1
- Overwriting index of a collection fails HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongock.