jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.47k stars 4.02k forks source link

Change dependencies from Mongobee to Mongock #8678

Closed michael-pratt closed 5 years ago

michael-pratt commented 5 years ago
Overview of the issue

Mongobee appears to have been abandoned as there have been several open issues in the past 6 months without any feedback from the maintainers. The main issue is that Mongobee uses an API that does not work with MongoDB Atlas (Mongo's cloud offering).

Mongock was derived from Mongobee, and among other things, provides support for MongoDB Atlas.

I wanted to pose the question of whether or not JHipster should move from Mongobee to Mongock.

Motivation for or Use Case

Allow creation of JHipster applications that can run with MongoDB Atlas.

Reproduce the error

Build a JHipster app with Mongo support, and configure it to use a MongoDB atlas instance. The application will not start.

Related issues

See #8665 for more details of startup failures and background on the core issue with MongoDB atlas support.

Also for reference: https://github.com/mongobee/mongobee/issues/86

Suggest a Fix

For my project I manually swapped out the dependencies on Mongobee for Mongock in pom.xml, and also update the 3 database configuration classes that use Mongobee.

JHipster Version(s)

5.5

JHipster configuration

N/A

Entity configuration(s) entityName.json files generated in the .jhipster directory

N/A

Browsers and Operating System

N/A

pascalgrimaud commented 5 years ago

You didn't mention that you would be happy to submit a PR :-) If we all agree, to migrate, of course

michael-pratt commented 5 years ago

Ha, well I guess I'll publicly declare my offer of PR here then :)

I scanned the generator codebase and it looks like 5 files that would need updating:

$ find . -type f -exec grep -li mongobee {} \;
./generators/server/templates/build.gradle.ejs
./generators/server/templates/pom.xml.ejs
./generators/server/templates/src/main/java/package/config/CloudDatabaseConfiguration.java.ejs
./generators/server/templates/src/main/java/package/config/DatabaseConfiguration.java.ejs
./generators/server/templates/src/main/java/package/config/dbmigrations/InitialSetupMigration.java.ejs

I need to do a little more regression with a typical, stand alone MondoDB cluster but overall the changes are pretty straight forward. I'm not 100% sure what to do with CloudDatabaseConfiguration since the Mongock API doesn't accept a URI directly, but we can cross that bridge later if needed.

DanielFran commented 5 years ago

@michael-pratt It is need also needed to change jhispter project to substitute the dependency: https://github.com/jhipster/jhipster/blob/master/jhipster-dependencies/pom.xml#L231

jdubois commented 5 years ago

I totally agree that Mongobee looks abandoned and that we need to move on, but Mongock only has 11 stars and 3 contributors, so I'm worried we rely on a project which is too small.

It looks like those tool are quite short-lived (we already moved away from Mongeez in the past!), so it looks to me that people are not really using them.

So this worries me: shouldn't we code this directly? Is the added-value of those tools big enough?

pascalgrimaud commented 5 years ago

Another solution would be to do the same as we do for Cassandra:

Then, in real production, the users need to manage the changes in MongoDB

pascalgrimaud commented 5 years ago

I think we are stuck with Mongobee

dieppa commented 4 years ago

@pascalgrimaud keep in mind the lock mechanism is poor. If you use Kubernetes or something goes wrong during the migration, the lock will stay there and you can get lost in an infinite loop.

dieppa commented 4 years ago

An option could be Jhipster adopting Mongock or contribute directly. I am happy to either add you as official contributor or transfer it and keep contributing myself as I am doing. Some help would be great

atomfrede commented 4 years ago

Maybe we should discuss this in a new issue, I think mongock looks very promising althought I am not sure we can do the maintenance for that (as we are already have a lot of stuff to maintain).

dieppa commented 4 years ago

Yes, I think it would be good to discuss it in a new ticket.

Thanks