# BAT-047: 이벤트 발행 연결 신뢰성 — idle keepalive + 재시도/재연결 + DLQ 가시성 + baseline 정합 (OPS-005) - Status: release-candidate - Profile: standard - Source Discovery: dcy-031 - Included REQ: REQ-091, REQ-092, REQ-093, REQ-094 - Excluded REQ: 없음 ## Summary - OPS-005 운영 리포트 기반 발행 신뢰성 4건을 단일 batch로 묶는다. 발행 재시도+강제 재연결(REQ-091), idle keepalive(REQ-092), DLQ 가시성+emit ERROR 경보(REQ-093)는 같은 발행 경로(`publish_event`/`_publish_dlq`/`_make_event_emitter`)를 공유하고, 동일 messaging 검증 스위트에서 검증된다. baseline 문서 정합(REQ-094)은 구현 완료 후 같은 batch에서 처리한다. - M2(trex-tsl-v1 라이브, 6/28 목표) 선행 조건. idle 60초 후 첫 슬롯 전이 이벤트 유실 결함 제거. ## Scope - In Scope: - `trex_core/adapters/messaging/rabbitmq.py` — `publish_event` 재시도+강제 재연결(REQ-091), keepalive `process_data_events` 틱(REQ-092), `_publish_dlq` ERROR 로그(REQ-093) - `trex_core/runtime/daemon.py` — `_make_event_emitter` ERROR 경보 강화(REQ-093), keepalive 틱 연동(REQ-092) - `tests/adapters/messaging/` — half-open 시뮬레이션, 재시도 소진, idle keepalive, DLQ 경보 신규 테스트 - `tests/application/test_messaging_event_publisher.py` — 기존 회귀 유지 - `docs/runtime-flows.md`, `docs/project-structure.md`, `docs/operations.md` — baseline 정합(REQ-094) - Out of Scope: - 이벤트 영속 outbox(옵션 C) — M3 후보 - consumer(orb/tsl) idempotency 구현 - RPC client(`call_rpc`) 연결 정책 - `docs/interface-contract.md` 변경 — AMQP wire 계약 불변 ## Documents - Planning: [planning.md](./planning.md) - Design: [design.md](./design.md) - Implementation: [implementation.md](./implementation.md) - Verification: [verification.md](./verification.md) ## Notes - R-1(High): M1 라이브 trex-core — 변경은 발행 경로에 국소화, wire 계약·consume/RPC 경로 불변. opus qc-reviewer 강제(dcy-031 §10 CONFIRM①). - R-2(Medium): pika 스레드 비안전성 — keepalive I/O는 발행 연결 소유 스레드에서만 실행(OQ-1 설계 확정). - R-3(Medium): 재시도 at-least-once 중복 가능 — OQ-2는 delivery 검증으로 추적(소비자 멱등성). - NFR-2 타임아웃 수치는 design 단계에서 확정.