문제: Gradle 루트가 src/라서 빌드 도구(build-logic, gradle, config, 빌드
파일)가 계층 코드 폴더 옆에 섞여 있다. composition과 app-bootstrap은 같은
조립 계층인데 폴더가 따로이고, application 모듈 넷은 최상위에 흩어져 있다.
「Gradle은 src/에서 실행」이라는 예외 규칙이 모든 문서와 스크립트에 퍼졌다.
고른 방법: 저장소 루트를 Gradle 루트로 하고 src/에는 계층 코드만 둔다
(design-docs repo-structure/01-backend-layout.md 6.1절 가-2·가-3, 소유자
승인 2026-11-07). 이 커밋은 git mv만 한다. 이름 바꾸기 감지가 1541개
파일 모두를 R100으로 잡도록 내용을 바꾸지 않았다. 바뀐 곳은 둘뿐이다:
src/.gitignore의 줄을 루트 .gitignore로 옮겼다.
- 빌드 파일, gradle/, build-logic/ → 저장소 루트
- config/checkstyle·spotbugs → config/ (코드 검사 도구 설정만)
- registry config/architecture/modules.json → gradle/modules.json,
시험 이미지 config/testing/container-images.properties
→ gradle/container-images.properties, registry 설명 → gradle/README.md
- Dockerfile, .dockerignore, .env*.example → 저장소 루트
- src/README.md(빌드·env 참조) → docs/build.md
- src/domain-core → src/domain/core,
src/application-* → src/application/*,
src/app-bootstrap → src/bootstrap/app,
src/composition/* → src/bootstrap/*
- 기능 생성 템플릿 scripts/feature-scaffold/{templates,probes}/src/ 아래도
같은 모양으로(domain/core, application/core, bootstrap/app)
위험: 이 커밋만으로는 빌드되지 않는다. 경로를 부르는 곳은 다음 커밋이
고친다. 두 커밋을 나눈 것은 파생 서비스가 merge할 때 이름 바꾸기와 내용
변경을 따로 보게 하려는 것이다.
검증: git diff --cached -M --name-status 에서 R100 1541개, 그 밖은
.gitignore 수정과 src/.gitignore 삭제뿐.
BREAKING CHANGE: 모든 빌드 파일과 계층 폴더의 경로가 바뀐다. 옛 경로 →
새 경로 표와 받는 순서는 docs/upgrade/2026-11-relayout.md에 있다.
Refs: design-docs repo-structure/01-backend-layout.md 6.1절
4.5 KiB
4.5 KiB
composition:notification-platform — 알림 capability
- Module ID:
composition-notification-platform - Gradle path:
:composition:notification-platform - Package:
dev.caskeleton.composition.notification - 테스트:
./gradlew :composition:notification-platform:test --console=plain
제공하는 것
이 모듈 하나를 붙이면 알림 기능 전체가 들어온다.
composition:notification-platform
├─ NotificationApplicationCompositionAutoConfiguration (use case 조립, `enabled` 조건)
│ ├─ NotificationSubmissionConfiguration 접수·예약·취소·조회·템플릿 발행 use case
│ ├─ NotificationDeliveryConfiguration 발송·재조정·lease 회수·ledger 투영·운영자 plane
│ └─ NotificationCallbackConfiguration provider 콜백 수집 + ProviderCallbackIngressBridge
├─ config/module-defaults/notification.yml (설정 기본값, support 로더가 읽음)
├─ adapter:outbound:notification provider(SMTP·SES), 저장 외 런타임, NotificationPlatformAutoConfiguration
├─ adapter:outbound:persistence-notification (runtimeOnly) 알림 entity·저장소·Flyway stream
├─ adapter:outbound:persistence-jpa (runtimeOnly) DataSource·Flyway core·TransactionPort
└─ adapter:inbound:web-notification POST /notifications, POST /notification-templates,
POST /internal/notification/callbacks/{provider}/{profile}
- 조립 순서: 이 모듈의 root는
NotificationPlatformAutoConfiguration(outbound leaf) 뒤에 온다 (afterName). - 설정:
config/module-defaults/notification.yml을 support의ModuleDefaultsEnvironmentPostProcessor가 읽는다. 우선순위는 가장 낮다. 그래서application*.yml, 환경 변수, 시스템 속성이 항상 이긴다. app-bootstrap은 이 파일을 모른다. - 저장소: 요청·발송·ledger 테이블과 migration은
adapter:outbound:persistence-notification에 있고, 그 테이블이 사는 관계형 플랫폼(DataSource, Flyway core stream, capability schema registry,TransactionPort)은adapter:outbound:persistence-jpa다. 이 모듈이 둘 다runtimeOnly로 가져오므로 (fileserver와 같은 한 줄 원칙) 따로 넣을 줄은 없다.APP_PERSISTENCE_JPA_ENABLED=false로 끄면 안 된다.
추가할 한 줄
// app-bootstrap/build.gradle
runtimeOnly project(':composition:notification-platform') // 알림 (저장소·JPA 플랫폼 포함)
기본 조립에는 없다(app-bootstrap/build.gradle에 주석 처리된 줄로 있다). 이 줄을 지우면 use case
조립, provider 어댑터, HTTP 엔드포인트, 설정 기본값이 모두 함께 빠진다.
켜기와 끄기
모듈이 있으면 켜진다. app.notification.platform.enabled(APP_NOTIFICATION_PLATFORM_ENABLED,
기본 true)를 false로 줄 때만 꺼지고, 그때는 아무것도 바인딩하지 않는다. 켜진 상태에서는 아래
"항상" 키가 없으면 기동이 거부된다.
필요한 env 키
전체 목록과 타입·기본값은 docs/registries/env-keys.yaml의 APP_NOTIFICATION_*,
SPRING_MAIL_* 행이 SSOT다. 켤 때 실제로 넣어야 하는 것:
| 언제 | 키 |
|---|---|
| 항상 | 데이터베이스 연결 env(APP_DATASOURCE_URL, APP_DATASOURCE_USERNAME, APP_DATASOURCE_PASSWORD) |
| 항상 (키 7종과 각 키 id, 32바이트 이상 base64, 서로 달라야 함) | APP_NOTIFICATION_PLATFORM_{CONTACT_ENCRYPTION,CONTACT_LOOKUP_HMAC,CALLBACK_SIGNING,PROVIDER_CREDENTIAL,PAYLOAD_ENCRYPTION,PROVIDER_REQUEST_LOOKUP_HMAC,CALLBACK_FINGERPRINT_HMAC}_KEY, 같은 이름 + _ID |
| SMTP provider | APP_NOTIFICATION_PLATFORM_SMTP_ENABLED=true, APP_NOTIFICATION_PLATFORM_SMTP_SENDER_IDENTITY, SPRING_MAIL_HOST, SPRING_MAIL_PORT, SPRING_MAIL_USERNAME, SPRING_MAIL_PASSWORD |
| SES provider | APP_NOTIFICATION_PLATFORM_SES_ENABLED=true, APP_NOTIFICATION_PLATFORM_SES_SENDER_IDENTITY, APP_NOTIFICATION_PLATFORM_SES_ACCESS_KEY_ID, APP_NOTIFICATION_PLATFORM_SES_CREDENTIAL_KEY_ID, APP_NOTIFICATION_PLATFORM_SES_REGION |
| provider 콜백 | APP_NOTIFICATION_PLATFORM_CALLBACKS_ENABLED=true, SES는 APP_NOTIFICATION_PLATFORM_SES_ALLOWED_TOPIC_ARNS, 프록시 뒤라면 APP_SERVER_FORWARD_HEADERS_STRATEGY=native + server.tomcat.remoteip.internal-proxies(콜백 전용 프록시 목록은 없다) |
나머지(발송 배치 크기, lease, 준비 상태 임계값 등)는 기본값으로 동작한다. 설명은
docs/notification/configuration-reference.md.