feat: redis, fileserver, httpclient 런타임 시점 구현 추가

This commit is contained in:
donghyeon-ka
2026-07-28 14:26:54 +09:00
parent 7363b2aa1e
commit b3add0162d
257 changed files with 30430 additions and 1357 deletions
@@ -4,47 +4,45 @@
- Module ID: `adapter-outbound-persistence-mongo`
- Gradle path: `:adapter:outbound:persistence-mongo`
- Focused test: `./gradlew :adapter:outbound:persistence-mongo:test --console=plain`
- Focused test (derived from Gradle path): `./gradlew :adapter:outbound:persistence-mongo:test --console=plain`
- Runtime baseline: Java 21; repository framework baseline: Spring Boot 4.0.0.
- Registry SSOT: `.harness/project/modules.yaml`.
- Registry SSOT: `src/config/architecture/modules.json`.
Package root: `dev.caskeleton.adapter.outbound.mongo`. Driven (outbound) adapter — **lightweight
Spring Data MongoDB scaffolding**. Design rationale lives in [README.md](README.md).
Package root: `dev.caskeleton.adapter.outbound.mongo`. Driven (outbound) adapter — opt-in Spring
Data MongoDB infrastructure. Design rationale lives in [README.md](README.md).
## Responsibility
- Demonstrate MongoDB-backed persistence: opt-in Mongo config + a self-contained example document /
repository / adapter showing the document↔domain mapping boundary. It does **not** reimplement
idempotency / outbox / lock on Mongo (those stay JPA-only).
- Provide opt-in Mongo client and template infrastructure without shipping a fake business domain.
- Real forks add their own document, repository, mapper, and application/domain port implementation.
- It does **not** reimplement idempotency / outbox / lock on Mongo (those stay JPA-only).
- Opt-in: `MongoPersistenceConfig` re-imports the Mongo auto-configuration (`@ImportAutoConfiguration`)
and enables repositories (`@EnableMongoRepositories`, scoped to this package via
`basePackageClasses`) only when `ca-skeleton.persistence-mongo.enabled=true` (default off). The
connection URI comes from Spring's standard `spring.data.mongodb.uri`.
only when `ca-skeleton.persistence-mongo.enabled=true` (default off). The connection URI and
database come from Spring's standard `spring.data.mongodb.*` settings.
- `MongoOptInAutoConfigurationImportFilter`, registered through `META-INF/spring.factories`, blocks
Boot 4's classpath-driven sync/reactive/data/repository/health/metrics Mongo auto-configuration
when the module enable flag is absent or false.
## Allowed
- Project deps: `:application-core`, `:shared-contract` — SSOT is the
`adapter-outbound-persistence-mongo` entry in `.harness/project/modules.yaml`; `src/build.gradle`
enforces it. No
`:domain-core`, no sibling adapters.
- No project dependency is required by the generic infrastructure. The allowed-edge SSOT remains
the `adapter-outbound-persistence-mongo` entry in `src/config/architecture/modules.json`.
- External: `org.springframework.boot:spring-boot-starter-data-mongodb` (version via the shared
Spring Boot BOM), `spring-boot-configuration-processor` (annotation processor). Test-only:
Testcontainers (`testcontainers`, `testcontainers-junit-jupiter`), BOM-managed.
Spring Boot BOM), `spring-boot-configuration-processor` (annotation processor).
## Forbidden
- Inbound adapters, sibling outbound adapters, `app-bootstrap`, `sample-portfolio` (ArchUnit
`OUTBOUND_ADAPTERS_*` family rules).
- Leaking the `ExampleMongoDocument` type outside the adapter — the adapter maps documents to the
module-local `ExampleRecord` at the edge.
- Inventing an `application-core` port for the example (scaffolding stays self-contained); adding
idempotency/outbox/lock on Mongo.
- Shipping placeholder `Example*` document, repository, record, or adapter types in production.
- Adding idempotency/outbox/lock on Mongo without a separately approved contract.
- Fully-qualified inline type references; more than one public top-level type per file.
## Tests
`ExampleMongoMapperTest` (pure mapping, no container), `ExampleMongoRepositoryIT` (Testcontainers
MongoDB save/find/derived-query, `disabledWithoutDocker`).
`MongoPersistenceConfigTest` proves default/false behavior through an actual
`@EnableAutoConfiguration` context, typed enablement binding, and enabled infrastructure with a
mock `MongoClient` plus a real `MongoTemplate` without a network connection.
```bash
cd src