Reviewed on 2026-10-26 against BIF5-SWEN3_RatingMatrix.xlsx and the twelve lecture PDFs supplied in Downloads/swen3. The course baseline and inspected checkout are 28ef27347fb16e076f24449a78072f480bd443d9, branch feature/53-rabbitmq-compose. The implementation is a useful case study with confirmed defects and unfinished requirements, not a reference solution to copy unquestioningly.
Evidence and scope
The existing backend suite ran successfully with Eclipse Adoptium Java 25.0.4: 131 tests, zero failures or skips. Five additional desired-behavior checks ran in an isolated copy and all five failed, reproducing the three correctness findings below. The original backend source and the supplied assessment files were not changed. The verification record includes suite counts, individual failures, environment, and limitations; the diagnostic tests can be repeated in a practice checkout.
These checks use H2 with Flyway disabled and Hibernate create-drop. The HTTP probes use an authenticated test principal, while the existing suite separately tests the bearer login chain. The lost-update probe uses real transactional service calls in a deterministic interleaving, not simultaneous threads. PostgreSQL migrations, the deployed Compose stack, and a complete browser-to-worker pipeline were not run. Compose configuration passed a static check with the example interpolation file and service env-file resolution disabled; that does not validate a real .env.local or running containers.
The rubric assigns 100 possible points. Its awarded-points cells are blank: the cached zero in F39 is not an awarded grade. The rubric describes categories, but does not enumerate every required core use case or name the individually agreed additional use case. No assignment brief establishing those details was supplied. MinIO/Gemini claims below come from this project's OpenAPI contract, not from an invented rubric requirement. Original filenames, hashes, rubric descriptions, and cell rows are preserved in assessment context.
Findings that should change the implementation
F1 — Background processing is missing from the checked-out baseline
Priority: high; unfinished capability and API-contract mismatch. RatingMatrix!B14:E14 explicitly assesses queues, workers, and scheduled processing (4 points). B8:E8 assesses the required core use cases (5 points). A RabbitMQ container alone does not establish either behavior.
The Compose file starts RabbitMQ, but the baseline build has no AMQP dependency and its main source has no queue publisher, listener, or scheduler. Upload writes a local file and creates a PENDING document with null OCR/summary fields. There is no processing path that advances that state. Search scans visible documents in memory; Elasticsearch-looking configuration alone is not an integration.
Meanwhile, the upload contract promises MinIO storage, asynchronous OCR, indexing, and Google Gemini summarization, and describes the 201 response as queued. Those promises are not fulfilled by this checkout.
Branch qualification: local branches feature/54-backend-ocr-queues (d84824f), feature/55-queue-exceptions (a635681), and feature/56-queue-logging (5593b4c) contain newer work. A read-only inspection of the latter found an outbox, dispatcher, RabbitMQ publisher, scheduler, exception translation, and logging. They are outside the checked-out baseline and this execution record. Its OcrWorker is a listener stub that only logs receipt and has a TODO for OCR/idempotency; the branch's worker setting defaults to disabled. Do not infer working OCR, summarization, or indexing from the presence of these types. Integrate and validate the intended branch before reassessing this row.
Correction: finish a durable processing path and test delivery, retry, duplicate handling, status/result persistence, and eventual search visibility. Until then, label the endpoint documentation as planned where appropriate. Do not mark the queue criterion complete based on infrastructure provisioning.
F2 — Document-type partial updates can overwrite another request's change
Priority: high; reproduced data-loss behavior. The controller reads the current model in one service call and merges the DTO before invoking a separate write transaction. The write service reads the latest row, then replaces the stale model's version with that latest version.
Reproduction with real H2 persistence:
- Request A reads a type with description
originaland version v. - Request B commits description
changed by B, advancing the version. - A requests only a name change. The controller mapper fills the omitted description from A's old snapshot.
- The service attaches the newly loaded version to A's stale description and saves it.
- The stored description becomes
original; B's change is lost.
The diagnostic assertion expected changed by B and received original. Optimistic locking cannot reject stale data after the application has substituted a current version for it. The existing unit test checks that the service substitutes the current version; that is not proof that the complete read/merge/write flow is safe.
Correction: pass an update command containing only the client's intended fields to one transactional service method. Load current state and merge there, preserving that read's version. If the API deliberately accepts a client snapshot/version, compare it and reject staleness rather than refreshing the version on stale contents. Test this exact interleaving. A mapper may translate intent but should not decide current state outside the transaction.
F3 — Malformed request parameters return server errors
Priority: medium; reproduced HTTP error-classification defect. With an authenticated test principal, both GET /api/v1/documents/not-a-uuid and GET /api/v1/documents?page=not-a-number returned 500, where the checks expected 400.
GlobalExceptionHandler handles several validation exceptions but its broad Exception handler catches unhandled MVC type-conversion errors and translates them into an internal-server response. This affects rubric REST, validation, and stability evidence (B9:E9, B16:E17).
Correction: preserve MVC's client-error classification, either through appropriately specific handlers or a properly configured framework exception-handler base. Cover invalid UUIDs/numbers and related missing/invalid request inputs with HTTP-level tests. Do not turn every exception into 400; unexpected server failures still require 500.
F4 — The PDF upload contract accepts non-PDF and empty files
Priority: medium; reproduced validation gap. An authenticated upload of notes.txt with text/plain content returned 201. An empty empty.pdf with application/pdf also returned 201. The published contract describes binary PDF uploads.
The controller accepts bytes and declared content type, and the service validates title and references without validating PDF content. Entity validation tests explicitly allow zero file size; database metadata constraints cannot establish that uploaded bytes form a usable PDF.
Correction: define the supported-file policy and enforce it on the server before accepting a processing job. Check emptiness and size, treat the client MIME type as untrusted metadata, and validate parseability using the chosen document processor. Reject unsupported/malformed input consistently and leave neither an orphan file nor a queued invalid job. This finding concerns the project's stated PDF contract; the rubric itself only says validation must cover the layers/components.
Architecture corrections for the course
The existing separation of DTOs, models, JPA entities, and persistence adapters is valuable evidence for mapping and loose coupling. It is not proof that every use case or architectural goal is complete.
- DDD and business layer:
business-layer.pdfPDF pages 2–5, 13–18 andddd-intro.pdfpages 4–11 emphasize invariants, value objects, aggregate boundaries, and a protected domain. Current models largely hold data; rules live in large services.DocumentServiceImplalso performs filesystem operations, obtains actor identity globally, and registers transaction callbacks. Teach extraction of policy/value objects and storage/actor ports as improvements, not as already implemented behavior. Application-level transaction annotations are not themselves a DDD violation. - ACL:
business-layer.pdfpage 15 discusses an anti-corruption layer at a legacy-system boundary. The project's “persistence ACL” provides model translation and a port/adapter boundary. Explain that narrower usage explicitly. It does not establish a complete external-system semantic ACL, and Spring paging types and persistence-related errors still cross some boundaries. - Layer versus tier:
multi-tier.pdfpages 2, 7–12 distinguishes deployment units from logical layers. Controllers, services, and repositories inside one backend process are layers. UI, backend, database, and broker are deployment components. A broker container is not evidence that the business workflow uses asynchronous communication. - MapStruct:
java-mapstruct.pdfpages 6–7, 10, 14, 16–20 motivate generated mapping and explicit conversions. Generated implementations here are Spring component classes with instance methods; they are not universally “static final.”@InheritInverseConfigurationcannot reconstruct an arbitrary inverse of a Java expression.@MappingTargetalone does not define missing-versus-null update semantics. Inspect generated code and contract tests instead of treating every illustrative slide as literal implementation guidance. The official inverse-configuration API and update null strategy confirm these distinctions. - IoC/DI:
inversion-of-control.pdfpages 14–18, 23, 32–34 distinguishes supplying dependencies from dependency direction. Kotlin primary-constructor injection replaces the need for a Lombok-generated constructor here. The slide's annotation on a field is field injection, not setter injection. Dependency injection can still inject a concrete framework dependency; that alone does not make a domain independent. - Transactions:
db-transactions.pdfpages 2, 5–11 motivates ACID, 2PC, and compensation. In-process file callbacks are neither durable saga state nor a distributed atomic commit. A saga's compensation can itself fail and requires recovery. The checked-out Compose file mountsdocument-filesat/tmp/paperless-documents, so uploaded files survive container replacement when that named volume is retained. Standalone runs use the local temporary directory; neither case provides database/filesystem atomicity. - OAuth/JWT:
oauth2-with-jwt.pdfpages 4–12, 18–20 describes authorization roles, flows, and JWT verification. The implementation issues custom opaque bearer tokens with database-backed introspection. It is not an authorization-code/PKCE implementation or a JWT resource server. The rubric does not explicitly require JWT; the existence of a JWT lecture alone does not prove a grading failure. - ORM:
spring-jpa.pdfpages 7–11 introduces repositories and cascades using simplified examples.DETACHpropagates detachment, not persistence, as defined in the Jakarta Persistence entity-operation specification. A controller directly using a repository on the recap slide is not the layered target of this course. Test actual migration/constraint behavior on PostgreSQL as well as entity mapping on H2.
Rubric evidence matrix
Cells below refer to the RatingMatrix sheet. “Evidence” means inspected code or an executed check, not awarded marks. Full points also require explanation and demonstration to the examiner.
| Cells | Criterion / maximum | Current evidence and remaining work |
|---|---|---|
| B8:E8 | Core use cases / 5 | Document/user/team/type APIs and tests exist. Processing promised by OpenAPI is incomplete at the pinned baseline. Confirm the complete assignment use-case list. |
| B9:E9 | REST API / 5 | Generated APIs, controllers, DTO mappers; fix F2–F4 and demonstrate error behavior. |
| B10:E10 | Web frontend / 5 | UI exists in the repository, but this backend review did not assess its usability or complete workflows. Backend-only coursework cannot establish this row. |
| B11:E11 | Additional use case / 5 | The individually agreed feature is unknown. The course's archive exercise is a proposal, not evidence of an approved or completed additional use case. |
| B14:E14 | Queues/background processing / 4 | RabbitMQ is configured in baseline Compose; no baseline producer/consumer/scheduler. Later local branches contain unintegrated queue work. See F1. |
| B15:E15 | Logging / 2 | Request ID/timing filter, service action logs, exception/security logs and logging tests exist. Demonstrate coverage across actual asynchronous components once integrated. |
| B16:E16 | Validation / 2 | Generated DTO constraints, service checks and entity constraints exist. F3/F4 show gaps; pure domain invariants are uneven. |
| B17:E17 | Stability patterns / 2 | Domain exception types and HTTP translation exist; raw infrastructure/framework concerns still leak, and F3 misclassifies input errors. Durable retry/recovery is unproven for the complete processing flow. |
| B18:E18 | Unit tests / 2 | Mock-based service tests and focused mapper/entity checks are present and pass. Five additional checks expose missing assertions; no measured coverage threshold was established. |
| B19:E19 | Integration tests / 2 | H2 persistence and MockMvc critical-path tests pass. No production PostgreSQL migration or full document-to-worker-to-result test was executed in this review. |
| B20:E20 | Clean code / 6 | Feature packages and constructor injection are consistent strengths. Direct filesystem/security-context coupling, service concentration, and the split update workflow need attention. |
| B23:E23 | Containerized deployment / 10 | Multi-stage backend Dockerfile, UI/DB/broker Compose services, database/broker health checks and named volumes exist. Static Compose check only; prove a clean deployment, restart persistence, and all integrated services. |
| B24:E24 | Loose coupling / 2 | Service and persistence interfaces isolate entities. Framework paging and static security context still couple business operations to infrastructure. |
| B25:E25 | Mapper / 2 | MapStruct 1.6.3 + kapt, two mapping boundaries, converter qualifiers, constructor injection and compile-time target checking. Correct F2's update orchestration; mapping boilerplate removal is not concurrency correctness. |
| B26:E26 | Dependency injection / 2 | Spring constructor injection is used in controllers/services/adapters/mappers. Explain lifetimes and remaining hidden dependencies. |
| B27:E27 | DAL / 2 | JPA repositories, adapters, migrations and version columns exist. H2-generated schema does not validate Flyway PostgreSQL scripts. |
| B28:E28 | BL / 2 | Use-case services coordinate validation, authorization and transactions. Processing workflow is incomplete in this baseline; domain models do not yet enforce many invariants themselves. |
| B31:E31 | GitFlow / 5 | Local feature/develop/main branches and merge/PR references exist. Show the actual team workflow and review evidence; branch names alone are insufficient. |
| B32:E32 | Issue tracking / 5 | Commit messages reference issue numbers. Board freshness, assignment and completion evidence were not available from this checkout. |
| B33:E33 | CI/CD / 5 | Backend GitHub Actions runs compile, test and package steps. Workflow file existence and a local pass do not prove a successful hosted run; the workflow does not build the full Compose deployment. |
| B34:E34 | Documentation / 5 | Repository guides, OpenAPI and changelog exist. Resolve promised-but-absent behavior and outdated mapper conventions; include decisions, testing strategy and actual results. |
| B37:E37 | Knowledge / 20 | Prepare WHY/HOW/WHERE explanations for each boundary and failure path. Course completion is not a prediction of oral-review marks. |
Build the missing asynchronous use case
This is an implementation plan tied to the rubric, not a claim that the pinned source contains the solution. Study communication-patterns.pdf pages 9–13, event-driven-architecture.pdf pages 2–5, and business-layer.pdf pages 8–10 alongside it. The presentation slides (pages 15–21) distinguish polling, callbacks, and push mechanisms; refreshing the UI does not create a worker.
- Define processing contracts and ownership. Describe a job with stable ID, document ID, content reference, and schema version. Specify who transitions PENDING → processing → completed/failed and where results are authoritative. Use separate ports for storage, OCR, summarization and indexing where these are external concerns.
- Make accepting work durable. Persist document metadata and an outbox/job record in one database transaction. Commit before a dispatcher publishes. A publisher confirm means the broker accepted the message, not that OCR completed. Integrate the existing queue branches rather than duplicating their work without review.
- Handle redelivery deliberately. A publisher can crash after sending but before recording success. A worker can crash after storing results but before acknowledging. Use stable job IDs and idempotent transitions/results; a queue does not provide global exactly-once business execution automatically.
- Separate transient failure from invalid input. Validate uploads before queuing. Retry transient transport/provider failures with bounded delay, route exhausted jobs to a recoverable failed/dead-letter state, and persist diagnostic information without storing bearer tokens or document contents in logs.
- Translate external semantics at adapters. An OCR engine's confidence/status and a summarizer's failures need domain meaning. A search provider's scoring, pagination and highlights need a local contract. Avoid exposing vendor DTOs to controllers or domain rules.
- Preserve authorization during eventual consistency. Sharing can change while a job runs or an index is stale. Search/download must apply authoritative access policy; indexing is not an authorization grant. Define what happens to a job when its document is deleted.
- Demonstrate the deployment. Upload a valid PDF through the UI/API, observe a correlated job, obtain extracted text/summary, search it, and download the file. Repeat with a duplicate delivery, temporary broker outage, worker restart, invalid PDF and revoked team access. Retain named volumes and verify recovery; never use destructive volume deletion as a persistence test.
Review priorities and completion gates
Fix F2–F4 with regression tests, then integrate and complete the asynchronous flow against the agreed project scope. Validate PostgreSQL migrations and Compose deployment. Reconcile the additional use case with the instructor's agreement before treating the archive capstone as grading evidence. Complete the workflow/documentation evidence separately from the implementation.
For the oral review, be able to explain: why layers differ from tiers; why the domain/persistence boundary exists; how Kotlin nullability and immutable copies interact with JPA; what generated mapping does and does not prove; why F2 defeats optimistic locking; why an invalid UUID is a client error; and why a database transaction does not make file writes or message publication atomic.
To repeat the diagnostic checks, copy the test source into src/test/kotlin/at/fhtw/swen3/paperless/review/ in a separate backend checkout at the recorded revision and run ./gradlew test --tests '*ReviewRegressionTest'. Use an isolated java.io.tmpdir for test uploads. These assertions intentionally fail on the baseline; after a correction, require them to pass and rerun the existing suite. Do not add these failing diagnostics to the application's CI without the corresponding fixes.