Skip to content

Mongo backed jobRepository not working when using parallel processing Multi-threaded Step /asynch writer processor #4814

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

Open
ayoubeljabiry opened this issue Apr 24, 2025 · 1 comment
Labels
status: waiting-for-reporter Issues for which we are waiting for feedback from the reporter type: bug

Comments

@ayoubeljabiry
Copy link

ayoubeljabiry commented Apr 24, 2025

i faced MongoDB WriteConflict Error when tried to use parallel processing in my job application

Environment
using spring boot 3.4.5 with spring batch , mongodb 4.4

situation i read from a mongo db -> trnsfrom -> write to another mongo db, i use mongo as db for jobrepository collections
i use cursor based item reader and the standard mongoitemwriter

@ayoubeljabiry ayoubeljabiry added status: waiting-for-triage Issues that we did not analyse yet type: bug labels Apr 24, 2025
@fmbenhassine
Copy link
Contributor

How is parallelism configured? Do you use a concurrent step? I am asking because MongoCursorItemReader is not thread-safe and might be the cause of your issue.

Please share an example so we can understand the problem, here is an example with mongdb: https://github.com/spring-projects/spring-batch/blob/main/spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/MongoDBJobRepositoryIntegrationTests.java

@fmbenhassine fmbenhassine added status: waiting-for-reporter Issues for which we are waiting for feedback from the reporter and removed status: waiting-for-triage Issues that we did not analyse yet labels May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-reporter Issues for which we are waiting for feedback from the reporter type: bug
Projects
None yet
Development

No branches or pull requests

2 participants