spring-projects / spring-projects/spring-modulith
Mongo Event repository not working with archive Completion Mode
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 222
- PR merge metrics
- No merged PRs in 30d
Description
When using CompetitionMode ARCHIVE with Mongo Event repository following error occurs:
Command execution failed on MongoDB server with error 263 (OperationNotSupportedInTransaction): '$merge cannot be used in a transaction' on server ...
How to reproduce:
Add @SpringBootTest(properties = {CompletionMode.PROPERTY + "=ARCHIVE"}) to spring-modulith-examples/spring-modulith-example-epr-mongodb/src/test/java/example/ApplicationIntegrationTests.java
P.S. I see there are test for all Completion modes in MongoDbEventPublicationRepositoryTest, but for 1.x they were run against embedded Mongo and for 2.x i see that tests are skipped in CI.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by applying CompletionMode.ARCHIVE to spring-modulith-examples/spring-modulith-example-epr-mongodb/src/test/java/example/ApplicationIntegrationTests.java and reproducing the MongoDB transaction error. Then inspect MongoDbEventPublicationRepositoryTest and its CI skip configuration. Done means ARCHIVE mode works with the Mongo event repository and the relevant test runs successfully without the '$merge cannot be used in a transaction' failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, mongodb, spring-boot
- Domain
- database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 56/100