-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for MongoDB as JobRepository #877
Comments
Hey, guys. I and some friends could be interested in implementing this feature. If so, does anyone on the Spring Batch team can help us with some hints? |
@rcardin Thank you for your interest to help! You would need to implement 4 DAO interfaces ( You are welcome to contribute if you want. I would love to help if you need support on this! |
Hey @benas. First, thanks for pointing us to your stubs. They're handy. We started to look at the code, and we noticed immediately that the main business classes, such as However, as you know, Mongo doesn't generate ids of type Do you suggest having a conservative approach, trying to overcome the problem of the generated unique identifier with some trick like these, or to have a more disruptive approach, reviewing the models? |
I think you are hitting an issue similar to #1317. The implications of this choice touch not only the domain model (which is designed around sequences), but also other core parts of the framework, like:
As you can see, the impact of changing the type of |
@benas, thanks for the detailed response. We completely agree with you. We will implement a prototype that mimics sequences using Mongo features. |
@rcardin I managed to create a PoC based on counter documents as described in https://www.mongodb.com/blog/post/generating-globally-unique-identifiers-for-use-with-mongodb , section: "Use a single counter document to generate unique identifiers one at a time" [*]. While this avoided the need to change the type of entities to something other than
The persistence model in the aforementioned PoC tries to cover all these points and was designed to be usable by other non-relational solutions (ie no MongoDB specific annotations (like With that in place, we now need a way to convert entities from the domain model to the persistence model and vice-versa, without impacting the framework's logic. This is also done in the PoC, see the converter package. That said, and while the PoC seems to work, I think the "disruptive approach" (ie changing the Entity ID type to something other than If you are interested, I would be grateful if you could give the experimental feature a try and share your feedback! Thank you upfront. [*]: the potential contention drawback mentioned in the disclaimer does not really apply to Spring Batch, based on the frequency in which batch jobs are typically launched. |
Hi everyone, are there any plans to take the PoC by @fmbenhassine into the main spring batch projects soon? We would be interested to use this in production. |
Hey, we also would be interested in the MongoDB support for JobRepository. @fmbenhassine are there any plans or timelines when to bring it live? |
Hello Spring team, are there any plans to take the experimental PoCs into the main spring batch projects soon? |
Apologies for the late reply on this. It's great to see some interest and feedback, thank you all! I am eager to plan this feature for the next release, but I want to hear from those who tried the PoC if there are any major issues (minor issues can be fixed in subsequent patch releases). If no major issues, then I will plan it for the upcoming 5.2 release. |
@fmbenhassine everything works well, didn't see any major issues with PoC. |
Resolves spring-projects#877 Signed-off-by: Fabrice Bibonne <fabrice.bibonne@gmail.com>
Ramin Zare opened BATCH-2727 and commented
adding Support for storing Job instances in Mongo instead of JDBC
Issue Links:
("is duplicated by")
The text was updated successfully, but these errors were encountered: