Files
clean-architecture-backend-…/docs/messaging/configuration-reference.md
T
DongHyeonka d646c2f12f feat(messaging): 브로커 중립 메시징 플랫폼 24개 leaf 추가
messaging-superpowers-package 설계서/계획서 기반 구현.
registry를 19 → 43 leaf로 확장하고 src/messaging 아래 24개 leaf를 등록.

- core-api: M1 publish/consume + M2 batch·delayed·pause-resume
- policy/transport-spi: 재시도 결정, DLQ orchestration, admission control, lifecycle
- kafka·rabbit(Stable): contiguous commit, confirm/return 상관, 배치, 보안 설정
- pulsar·nats(Experimental): 기본 비활성, live 인증 없음을 코드로 기록
- outbox/inbox/claim-check: 트랜잭션 결합, lease, 무결성 검증
- admin: plan → approve → execute를 타입으로 강제
- 문서 9종, infra compose 7종, JMH 벤치마크 3종

검증: 아키텍처 게이트 3종 통과, 24개 leaf 전부 check 통과,
messaging 테스트 604개 통과/0 실패.

미완: 계획서가 요구한 실 브로커 IT 40개 중 7개만 작성.
Rabbit 13 / Outbox 6 / Inbox 4 / NATS·Pulsar·Share 5 / testkit 2 /
starter·admin 3, 그리고 TLS·ACL 2개가 남음.
2026-08-14 14:55:38 +09:00

4.3 KiB

설정 레퍼런스

Destination profile

messaging:
  destinations:
    order-events:
      broker: kafka-primary
      kind: EVENT_STREAM            # ASYNC_COMMAND | DOMAIN_EVENT | INTEGRATION_EVENT
                                    # | WORK_QUEUE | PUBLISH_SUBSCRIBE | EVENT_STREAM | REQUEST_REPLY
      tier: M1                      # M1 | M2 | M3
      physical:
        topic: order.events.v1
      schema:
        codec: application/json
        compatibility: BACKWARD_TRANSITIVE
        message-types: [order.created]
      guarantees:
        delivery: AT_LEAST_ONCE     # AT_MOST_ONCE | AT_LEAST_ONCE
        ordering: KEY               # NONE | DESTINATION | PARTITION | KEY
        external-side-effect: INBOX_TRANSACTIONAL
      producer:
        confirmation: REPLICATION_OR_PERSISTENCE_ACK
        timeout: 5s
        mandatory-routing: true
        idempotent: true
      consumer:
        group: order-projection
        concurrency: 6
        max-in-flight-per-ordering-unit: 1
        prefetch: 16
        handler-timeout: 30s
        manual-settlement: false
      retry:
        mode: PAUSE_PARTITION       # NONE | INLINE | BLOCKING | PAUSE_PARTITION
                                    # | RETRY_DESTINATION | BROKER_DELAYED
        max-attempts: 3
        initial-delay: 200ms
        max-delay: 2s
        multiplier: 2.0
        jitter: true
        ordering-impact: PRESERVE   # PRESERVE | ALLOW_REORDER
      dlq:
        destination: order-events-dlq
        max-redrive-count: 1
      payload:
        max-bytes: 1048576
        claim-check-threshold-bytes: 1048576
      key-resolver-configured: true
      production: true
      topology-auto-create: false

기본값

설정 기본값 근거
logical payload 최대 1,048,576 bytes portability. 초과는 Claim Check
global hard 최대 8,388,608 bytes 어떤 destination도 넘을 수 없는 상한
header 총 크기 32,768 bytes
header 개수 64
header key 128 bytes metric tag 안전
header value 4,096 bytes
publish timeout 5s
handler timeout 30s
graceful shutdown drain 30s
일반 destination retry 0회 자동 retry는 opt-in
DLQ redrive batch 100 한 번의 작업이 source를 덮치지 않게
Outbox relay batch 100
Outbox lease 30s
Outbox polling 500ms
metric dimension 상한 200 cardinality 폭발 방지

Broker profile

Kafka

messaging:
  brokers:
    kafka-primary:
      type: kafka
      stable: true
      production: true
      bootstrap-servers: [broker-1:9093, broker-2:9093]
      enable-idempotence: true      # stable에서 필수
      acks: all                     # stable에서 필수
      max-in-flight-requests-per-connection: 5   # 최대 5
      delivery-timeout: 30s
      enable-auto-commit: false     # 항상 금지
      tls-enabled: true             # production 필수
      authentication-enabled: true  # production 필수

RabbitMQ

messaging:
  brokers:
    rabbit-primary:
      type: rabbitmq
      stable: true
      production: true
      addresses: [rabbit-1:5671]
      publisher-confirms: true      # stable에서 필수
      publisher-returns: true       # stable에서 필수
      mandatory: true               # stable에서 필수
      confirm-timeout: 5s
      auto-ack: false               # 항상 금지
      prefetch: 16
      quorum-queues: true           # durable work queue 필수
      tls-enabled: true
      authentication-enabled: true

보안

messaging:
  security:
    kafka-primary:
      producer: { type: SASL_SCRAM, credential-id: kafka-producer }
      consumer: { type: SASL_SCRAM, credential-id: kafka-consumer }
      # admin은 application runtime에 설정하지 않는다
      hostname-verification: true
      access:
        publishable: [order-events]
        consumable: []
        administrable: []

Experimental / Optional

기본값은 전부 false다.

messaging:
  experimental:
    kafka-share: false
    pulsar: false
    nats: false
  bridge:
    spring-cloud-stream: false

Backpressure

messaging:
  backpressure:
    global-limit: 512
    per-destination-limit: 64      # global-limit 이하여야 한다

per-destination-limit > global-limit이면 global limit이 limit이 아니게 되므로 부팅에 실패한다.