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>
61 lines
3.9 KiB
Markdown
61 lines
3.9 KiB
Markdown
---
|
|
kind: CONCEPT
|
|
slug: messaging-cloudevents-c04
|
|
title: 왕복 검증이 producedAt 을 비교하지 않는다
|
|
topic: delivery-and-settlement-models
|
|
project: clean-architecture-backend-template
|
|
status: 게시 전
|
|
sourceRevision: 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916
|
|
rootTreeNode: concept:messaging-cloudevents-c04
|
|
evidenceCapturedOn: 2026-09-01
|
|
assets:
|
|
- key: messaging-cloudevents-c04
|
|
file: ../../../final/evidence/rendered/messaging-cloudevents-c04.svg
|
|
- key: messaging-cloudevents-c04-diagram
|
|
file: ../../../final/assets/diagrams/messaging-cloudevents-c04.svg
|
|
evidence:
|
|
- ../../../final/evidence/raw/messaging-cloudevents-c04.txt
|
|
source:
|
|
- 원본 분석 절은 analysis/messaging/messaging-cloudevents.md#L113 이다.
|
|
module: messaging-cloudevents
|
|
---
|
|
|
|
# 왕복 검증이 producedAt 을 비교하지 않는다
|
|
|
|
봉투 → CloudEvent CloudEvent → 봉투 두 번째는 messaging-core-api의 MessageEnvelope javadoc과 정확히 짝을 이룬다 — "A null Kafka value is a tombstone, which is a distinct broker-native operation with different retention semantics." 봉투가 payload를 non-null로 강제한 이유가 여기서 실제 매핑 규칙으로 나타난다. ProducerId가 "deployment-independent service name, not a host, pod, or connection identity, so that it stays a bounded value safe for metric tags"라고 선언한 것과 같은 관심사다.
|
|
|
|
## 관계
|
|
|
|
- **왕복이라 부르는 테스트는 무엇을 보존하지 않는지도 적는다**
|
|
같은 분석 리프에서 끌어낸 규칙이다.
|
|
- **문서가 범위를 제한하면 그 제한을 누가 강제하는지 같이 적는다**
|
|
같은 분석 리프에서 끌어낸 규칙이다.
|
|
|
|
## 본문
|
|
|
|
<!-- body:start -->
|
|
|
|
매핑 방향이 둘이고, 두 번째는 `messaging-core-api`의 `MessageEnvelope` javadoc과 정확히 짝을 이룬다 — "A null Kafka value is a tombstone, which is a distinct broker-native operation with different retention semantics." 봉투가 payload를 non-null로 강제한 이유가 여기서 실제 매핑 규칙으로 나타난다.
|
|
|
|
## producerFrom 의 방어가 완전하지 않다
|
|
|
|
`ProducerId`가 "deployment-independent service name, not a host, pod, or connection identity, so that it stays a bounded value safe for metric tags"라고 선언한 것과 같은 관심사다. **다만 이 방어는 완전하지 않다** — 마지막 세그먼트가 여전히 120 UTF-8 바이트를 넘거나 제어문자를 담을 수 있고, 그 경우 `ProducerId` 생성자가 `IllegalArgumentException`을 던진다(§4.5). `urn:service:order-api` → `order-api`(테스트가 쓰는 형태), `https://a.example/very/long/path/x` → `x`.
|
|
|
|
## MessageEnvelope 참조 위치
|
|
|
|
:::evidence key="messaging-cloudevents-c04" alt="코드베이스에서 MessageEnvelope 를 검색한 출력 18줄. 이 기록이 세는 참조가 그 출력에 그대로 보인다." caption="MessageEnvelope 코드베이스 검색 — 18줄 · exit 0" zoom="true"
|
|
:::
|
|
|
|
## 봉투가 왕복에서 잃는 것
|
|
|
|
:::evidence key="messaging-cloudevents-c04-diagram" alt="원래 봉투에 occurredAt 과 producedAt 이 있고 왕복 후 봉투에서 producedAt 만 빗금으로 놓인다" caption="봉투가 왕복에서 잃는 것" zoom="false"
|
|
:::
|
|
|
|
CloudEvents에는 `time` 하나뿐이므로 봉투의 두 시각(플랫폼이 봉투를 만든 때 / 사실이 일어난 때)을 구분할 수 없다. 같은 값을 넣는 것은 합리적 선택이지만 **정보 손실이 기록되지 않았다** — 왕복 후 `producedAt`은 원래 값이 아니다.
|
|
|
|
## 테스트가 비교하지 않는 필드
|
|
|
|
왕복 검증(`roundTripsBackToAnEnvelopeWithoutInventingATombstone`)이 `messageId`·`messageType`·`schemaVersion`·`correlationId`·`tenantContext`·`payload`만 비교하고 `producedAt`은 비교하지 않는다. fixture에서 `producedAt`은 `09:15:01Z`, `occurredAt`은 `09:15:00Z`로 **일부러 다르게** 설정돼 있으므로, 비교했다면 실패했을 것이다.
|
|
|
|
<!-- body:end -->
|