Files
document-haness/docs/clean-architecture-backend-template/tech-log-studio/transport-and-provider-semantics/case/case-messaging-kafka-f04.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.7 KiB

kind, slug, title, topic, project, status, sourceRevision, rootTreeNode, evidenceCapturedOn, assets, evidence, source, module, priority
kind slug title topic project status sourceRevision rootTreeNode evidenceCapturedOn assets evidence source module priority
CASE messaging-kafka-f04 시계를 주입받는 클래스가 한 곳에서만 벽시계를 읽는다 transport-and-provider-semantics clean-architecture-backend-template 게시 전 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916 case:messaging-kafka-f04 2026-09-01
key file
messaging-kafka-f04 ../../../final/evidence/rendered/messaging-kafka-f04.svg
key file
messaging-kafka-f04-diagram ../../../final/assets/diagrams/messaging-kafka-f04.svg
../../../final/evidence/raw/messaging-kafka-f04.txt
원본 분석 절은 analysis/messaging/messaging-kafka.md#L342 이다.
messaging-kafka P3

시계를 주입받는 클래스가 한 곳에서만 벽시계를 읽는다

KafkaConsumerRegistrar 의 설계 성질이 javadoc 에 적혀 있다. 주기마다 Instant now 를 받아 applyDueResumes(now) 로 넘긴다.

문제

KafkaConsumerRegistrar 의 설계 성질이 javadoc 에 적혀 있다.

주기마다 Instant now 를 받아 applyDueResumes(now) 로 넘긴다.

결론

그런데 그 짝인 등록 쪽은 이렇다.

이 리프에서 Instant.now() 를 읽는 유일한 자리다.

그리고 그 호출은 작업자 스레드에서 일어나므로 폴 스레드의 now 와 다른 순간이다.

결과는 두 가지다.

지연 재시도(requeue(Duration))의 재개 시점을 고정 시계로 시험할 수 없고, 시험이 Duration.ZERO 밖의 지연을 다루지 못한다 — 실제로 어떤 시험도 다루지 않는다.

수정은 생성자에 Supplier 를 하나 더 받는 것이다.

같은 저장소의 MessagingShutdownLifecycle 이 정확히 그 형태로 두 생성자를 둔다.

검증 환경

OpenJDK : 21.0.12 java -version 으로 확인 Gradle : 9.0.0 src/gradle/wrapper/gradle-wrapper.properties 의 distributionUrl 로 확인 확인 방식 : KafkaConsumerRegistrar 참조 5건 검색과 주입된 시계가 덮는 범위 대비 벽시계 호출 지점 확인 소스 수정 : x

재현 조건

원문은 analysis/messaging/messaging-kafka.md#L342 에 있다.

본문

KafkaConsumerRegistrar 의 설계 성질이 javadoc 에 적혀 있다 — 주기마다 Instant now 를 받아 applyDueResumes(now) 로 넘긴다.

시계가 닿지 않는 한 곳

:::evidence key="messaging-kafka-f04-diagram" alt="폴 주기의 now 만 주입된 시계가 덮는 범위 안에 놓이고 등록 쪽 Instant.now 가 바깥에 빗금으로 놓인다" caption="시계가 닿지 않는 한 곳" zoom="false" :::

그 짝인 등록 쪽이 이 리프에서 Instant.now() 를 읽는 유일한 자리다. 그리고 그 호출은 작업자 스레드에서 일어나므로 폴 스레드의 now 와 다른 순간이다.

KafkaConsumerRegistrar 참조 위치

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

결과 둘

지연 재시도(requeue(Duration))의 재개 시점을 고정 시계로 시험할 수 없고, 시험이 Duration.ZERO 밖의 지연을 다루지 못한다 — 실제로 어떤 시험도 다루지 않는다.

수정

생성자에 Supplier<Instant> 를 하나 더 받는 것이다. 같은 저장소의 MessagingShutdownLifecycle 이 정확히 그 형태로 두 생성자를 둔다.

확인하지 못한 것

시계를 고정해 두 경로의 시각 차이를 관측하지 않았다. 호출 지점의 코드 대조로 판정했다.