Files
document-haness/docs/clean-architecture-backend-template/tech-log-studio/schema-and-wire-models/concept/concept-messaging-schema-api-c03.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

3.3 KiB

kind, slug, title, topic, project, status, sourceRevision, rootTreeNode, evidenceCapturedOn, assets, evidence, source, module
kind slug title topic project status sourceRevision rootTreeNode evidenceCapturedOn assets evidence source module
CONCEPT messaging-schema-api-c03 아무것도 실패하지 않고 잘못된 성공이 나온다 schema-and-wire-models clean-architecture-backend-template 게시 전 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916 concept:messaging-schema-api-c03 2026-09-01
key file
messaging-schema-api-c03 ../../../final/evidence/rendered/messaging-schema-api-c03.svg
key file
messaging-schema-api-c03-diagram ../../../final/assets/diagrams/messaging-schema-api-c03.svg
../../../final/evidence/raw/messaging-schema-api-c03.txt
원본 분석 절은 analysis/messaging/messaging-schema-api.md#L113 이다.
messaging-schema-api

아무것도 실패하지 않고 잘못된 성공이 나온다

이 leaf에서 가장 밀도 높은 javadoc이다. 핵심은 "Nothing failed"다.

관계

  • port 계약은 동시성 요구를 적는다 같은 분석 리프에서 끌어낸 규칙이다.
  • 도달성 판정은 단어가 아니라 import로 확인한다 같은 분석 리프에서 끌어낸 규칙이다.

본문

이 leaf에서 가장 밀도 높은 javadoc이다. 타입만으로 키를 잡으면 실패가 발생하지 않고 잘못된 성공이 발생한다. 그리고 그 결과에는 등록된 적 없는 버전 라벨이 붙어 하위 감사 기록까지 오염된다.

타입만 키로 잡은 경로

:::evidence key="messaging-schema-api-c03-diagram" alt="미등록 버전 라벨이 타입만으로 조회와 이전 파서로 디코딩을 지나 잘못된 성공으로 이어진다" caption="타입만 키로 잡은 경로" zoom="false" :::

세 codec이 두 실패를 구분한다

JacksonMessageCodec.requireRegistered, AvroMessageCodec.schemaFor, ProtobufMessageCodec.requireRegistered가 모두 "타입은 아는데 버전을 모른다"와 "타입 자체를 모른다"를 다른 에러 코드로 구분한다(SCHEMA_VERSION_NOT_REGISTERED vs UNKNOWN_MESSAGE_TYPE). 그 구분이 있어야 운영자가 "등록을 빠뜨렸다"와 "오타다"를 나눌 수 있다.

JacksonMessageCodec 참조 위치

:::evidence key="messaging-schema-api-c03" alt="코드베이스에서 JacksonMessageCodec 를 검색한 출력 5줄. 이 기록이 세는 참조가 그 출력에 그대로 보인다." caption="JacksonMessageCodec 코드베이스 검색 — 5줄 · exit 0" zoom="true" :::

한도를 미리 잡지 않는다

new ByteArrayOutputStream(Math.min(maxBytes, 8_192)) — 주석: "a 1 GiB bound must not pre-allocate 1 GiB."

codec 자기 에러 코드를 그대로 던진다

errorCode가 생성자 인자다. 그래서 Avro는 AVRO_PAYLOAD_TOO_LARGE, JSON은 PAYLOAD_TOO_LARGE가 나온다. 테스트가 이 성질을 직접 단언한다(BoundedByteSinkTest.java:69-77, as("the sink reports the codec's own code, not a generic one")).

requireFits 는 예산을 소비하지 않는다

Protobuf는 직렬화 크기를 미리 알므로 첫 바이트 전에 거절할 수 있다. 그 뒤의 쓰기도 여전히 경계 안이다 — 주석: "this is a cheaper refusal, not a replacement for the bound." refuseIfBeyondLimitsize > maxBytes - written으로 비교하는 것도 의도적이다.