--- kind: QUESTION slug: messaging-core-api-f01 title: 선언된 핸들러 계약이 배선된 것과 다르다 topic: runtime-reachability-and-composition project: clean-architecture-backend-template status: 게시 전 sourceRevision: 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916 rootTreeNode: open-question:messaging-core-api-f01 questionStatus: OPEN verifiedOn: # 이 기록은 이번 회차에 실행 확인을 하지 않았다 source: - final/document.md#a19-messaging-core-api#L835 --- # 선언된 핸들러 계약이 배선된 것과 다르다 공개 API 가 먼저 보여 주는 핸들러 인터페이스를 구현해도 아무 데도 꽂히지 않는다. 실제 배선은 다른 타입을 받는다. ## 사실 MessageHandler(delivery/MessageHandler.java:14)의 저장소 전체 참조가 0 이다. git grep -n -w MessageHandler -- src ':!src/messaging/messaging-core-api' 가 exit 1 이다. 핸들러 결과를 정산으로 바꾸는 유일한 지점 DefaultDeliveryProcessor 는 Function, HandleResult> 를 받는다(:40,47). MessageDelivery 가 빠지면서 deliveryAttempt · redelivered · handlerDeadline · shutdownRequested 가 핸들러에 도달할 수 없다. DeliveryContext javadoc 이 설명하는 graceful drain 협력은 현재 배선으로 성립하지 않는다. ## 미지수 저장소 밖에 이 계약의 소비자가 있는가. 세 선택지 모두 그 답에 걸린다. ## 선택지 DefaultDeliveryProcessor 시그니처를 계약에 맞춘다 MessageDelivery 를 조립해야 하므로 DeliveryContext 생성 책임이 runtime 으로 간다. 두 타입을 이 leaf 에서 제거한다 실제 계약만 남고 공개 API 가 배선과 일치한다. 확장점임을 명시한다 파생 프로젝트가 구현하는 자리라면 javadoc 과 support-matrix.md 에 그 사실을 적는다. ## 다음 검증 git grep -n -w MessageHandler 와 DefaultDeliveryProcessor.java:40,47 로 현재 배선은 확정된다. 저장소 밖 소비자의 존재는 이 저장소 안에서 확인할 수 없다.