Files
document-haness/docs/clean-architecture-backend-template/tech-log-studio/contract-domain-and-bounds/reference/reference-messaging-inbox-jdbc-postgresql-f05.md
T
DongHyeonkaandClaude Opus 5 b2963105a8 docs(keycloak-session-store): import the session-storage lab as a new project
The keycloak project ended with four open questions that design could not
settle. A two-VM lab was built to answer them by measurement, and this is
that material: 26 experiments, 125 raw command outputs, 22 browser captures.

Follows the import procedure in README.md.

  source/     the originating repository verbatim — 78 documents, 28 SVGs,
              8 manifests, plus .source-revision recording the commit
  final/      the SSOT
    document.md   729 lines written from the 29 experiment documents, not
                  concatenated: what was predicted, what was measured, and
                  where the measurement itself was wrong
    evidence/raw    125 outputs, flattened to <experiment>__<file> because
                    the originals collided (01-baseline.txt appeared three
                    times) and the audit only globs the top level
    evidence/meta   one per raw file; command and exitCode are null and the
                    README says why rather than inventing them
    evidence/browser  22 captures
    assets/       three diagrams through techviz
    .techviz/     their VizSpecs

A separate project rather than an addition to keycloak: the B-layer answers
that project's four questions, but the A, C and D layers are about cluster
failure, SSO and operations, and one document.md should hold one subject.
The four question records there can point here through 관계.

Recorded rather than papered over: only three of the 28 diagrams were
remade. The repository forbids hand-drawn SVG and forbids titles inside the
canvas; all 28 originals carry both, so converting them is redrawing, not
reformatting. They stay in source/ and the gap is written into the document.

verify-pipeline.py passes. audit-records.py reports no issues.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 22:51:59 +09:00

53 lines
2.4 KiB
Markdown

---
kind: REFERENCE
slug: messaging-inbox-jdbc-postgresql-f05
title: 컬럼 폭은 애플리케이션 검증과 짝을 이룬다
topic: contract-domain-and-bounds
project: clean-architecture-backend-template
status: 게시 전
sourceRevision: 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916
rootTreeNode: reference:messaging-inbox-jdbc-postgresql-f05
verifiedOn: # 이 기록은 이번 회차에 실행 확인을 하지 않았다
source:
- analysis/messaging/messaging-inbox-jdbc-postgresql.md#L684
---
# 컬럼 폭은 애플리케이션 검증과 짝을 이룬다
## 관계
- **bounded purge가 구현돼 있고 호출되지 않아, cleanup이 스스로 막겠다고 한 장애를 일으킨다**
이 규칙의 근거는 같은 분석 리프의 판정이 소유한다.
- **속성을 이름으로 주장하는 테스트가 그 속성을 보일 수 없는 fake 위에서 통과한다**
이 규칙의 근거는 같은 분석 리프의 판정이 소유한다.
- **SQL 실패가 재시도 불가로 분류된다**
이 규칙의 근거는 같은 분석 리프의 판정이 소유한다.
## 목적
DB 가 먼저 거절하면 그 실패는 설정 오류가 아니라 인프라 오류의 모양으로 도착한다. 여기서는 긴 consumerId 가 SQLException 이 되고, 그것이 INBOX_RESERVE_FAILED · CONFIGURATION · retryable=false 로 분류돼 결국 설정 실수가 메시지 파킹으로 나타난다.
## 규칙
1. 컬럼에 폭이 선언돼 있으면 애플리케이션 층에도 같은 상한을 둔다
migration 이 consumer_id VARCHAR(160) 을 선언한다.
2. 지금 무엇을 검증하는지 확인한다
IdempotentConsumer · TransactionalInboxHandler · JdbcInboxRepository 셋 다 공백만 거절하고 길이를 보지 않는다.
3. 값 객체가 있으면 그 생성자가 상한을 갖는다
messaging-core-api 의 값 객체들이 바이트 상한을 생성자에서 강제하는 형태가 그쪽 §4.5 에 있다. consumerId 는 아직 값 객체가 아니다.
## 적용 조건
스키마가 폭을 정하고 그 값이 애플리케이션에서 문자열로 다뤄지는 모든 컬럼.
## 예외
폭이 실질적으로 도달 불가능할 만큼 넉넉한 경우는 예외로 둘 수 있다. 다만 그 판단이 어디에도 적혀 있지 않으면 예외가 아니라 미검증이다.
## 예시
V2__messaging_inbox.sql:10 의 컬럼 선언과 세 클래스의 검증 코드. 확인 방법은 161자 consumerId 로 reserve 를 부르는 것이다.