spring-projects / spring-projects/spring-modulith

Mongo Event repository not working with archive Completion Mode

Open
#1,412 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

in: event publication registry meta: waiting for feedback
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.