Repository navigation
Conversation
…blications. Signed-off-by: 김우성 <azunox9@gmail.com>
…ng status lookup. Signed-off-by: 김우성 <azunox9@gmail.com>
|
I found two completion-related edge cases during a follow-up review of this PR: completed publications could still match a non-completed status, and The implementation now addresses both cases:
Regression coverage now includes all five statuses and result ordering, completion by both entry points, legacy completed documents, deterministic lookup-then-completion interleavings, and the real registry's stale-publication-to-resubmission flow. The latter verifies that stale incomplete publications are resubmitted while completed publications and recently resubmitted publications are excluded. Validation used the MongoDB Testcontainers-backed repository test class across ./mvnw -B -pl spring-modulith-events/spring-modulith-events-mongodb -am \
-Dtest=MongoDbEventPublicationRepositoryTest \
-Dsurefire.failIfNoSpecifiedTests=false testResult: 94 passed, 2 skipped, 0 failures, 0 errors across 96 test cases. The two skips are the existing UPDATE-only cleanup test under the DELETE and ARCHIVE configurations. The full project test suite was not run. |
Preserve completed MongoDB publications during status lookup. Original pull request: GH-1856 Signed-off-by: 김우성 <azunox9@gmail.com>
Preserve completed MongoDB publications during status lookup. Original pull request: GH-1856 Signed-off-by: 김우성 <azunox9@gmail.com>
Preserve completed MongoDB publications during status lookup. Original pull request: GH-1856 Signed-off-by: 김우성 <azunox9@gmail.com>
|
That's merged, polished, and back-ported. Please give the snapshots a try. |
Closes #1855.
The staleness monitor uses
EventPublicationRepository.findByStatus(Status)to locate event publications inPUBLISHED,PROCESSING, andRESUBMITTEDstates before marking stale publications as failed.MongoDbEventPublicationRepositorydid not override this method and therefore relied on the interface's default implementation, which always returns an empty list. As a result, stale MongoDB-backed event publications could not be discovered, marked asFAILED, or subsequently resubmitted.This change implements
findByStatus(Status)for the MongoDB repository by querying the existingstatusfield. It reusesdefaultQuery(…)andreadMapped(…)to retain the repository's existing sorting and document-to-domain mapping behavior.The existing status lifecycle test has been extended to verify both
countByStatus(…)andfindByStatus(…)across the following transitions:PUBLISHEDafter publication creationFAILEDaftermarkFailed(…)RESUBMITTEDaftermarkResubmitted(…)For each transition, the test verifies that exactly one publication is returned for the current status and no publications are returned for the other statuses.
The targeted MongoDB repository test suite was executed with Testcontainers:
./mvnw -B \ -pl spring-modulith-events/spring-modulith-events-mongodb \ -am \ -Dtest=MongoDbEventPublicationRepositoryTest \ -Dsurefire.failIfNoSpecifiedTests=false \ testAll 55 tests passed with no failures or errors.