메시징 통신
소프트웨어 컴포넌트나 애플리케이션 간에 메시지를 교환하는 통신 방식이다.
구조와 동작 원리
구성 요소와 배치 원칙 (조사 기반 개념 설명 · 연결 순서나 토폴로지는 특정하지 않음)
프로듀서와 컨슈머가 직접 또는 중개 메시지 브로커를 통해 메시지를 교환한다.
메시지는 애플리케이션 데이터를 페이로드로 담고 선택적 속성·메타데이터를 부가하며 메시징 서버가 임시 보관한다.
애플리케이션 간 결합을 줄이고 오래 걸리거나 취약한 동기 프로세스를 제거하는 데 활용된다.
기대 효과
분산 컴포넌트 간 통신을 느슨하게 결합할 수 있다.
트레이드오프
메시징 기반 시스템은 본질적으로 분산 시스템이므로 다양하고 감지하기 어려운 장애가 발생할 수 있다.
소비 지연으로 메시지가 적체되면 브로커 자원 고갈과 전체 장애 확산이 발생할 수 있어 주의해야 한다.
운영 및 적용 가이드
종합 설명 · 원문 인용으로 검증된 항목과 구분됩니다. 실제 적용 전 확인이 필요합니다.
언제 사용하는가
주문 접수, 결제 후속 처리, 알림·이벤트 전파처럼 요청 경로와 후속 처리를 분리해야 하는 곳에 적합하다. 하나의 이벤트를 여러 소비자가 비동기로 처리하는 팬아웃에도 사용한다.
시나리오
대규모 이커머스에서 초당 수천 건 주문을 받는 주문 서비스가 주문 생성 이벤트를 메시지 브로커에 발행하고, 재고·결제·배송·알림 서비스가 각자 구독해 처리한다. 주문 API는 브로커 적재 후 빠르게 응답하고, 소비 실패는 재시도와 DLQ로 격리한다. 피크 시간에도 서비스 간 직접 호출 결합을 줄이고, 처리 지연과 적체를 모니터링해야 한다.
배치 원칙
- 메시지 페이로드는 업무 데이터 중심으로 작고 명확하게 두고 이벤트 ID·타입·버전·추적 ID 같은 메타데이터를 부가한다
- 도메인별 토픽과 큐를 분리하고 소비자 그룹 단위로 확장한다
- 브로커는 고가용 클러스터로 배치하고 파티션을 처리량에 맞춰 분산한다
- DLQ와 재시도 큐를 본 토픽과 분리해 장애 메시지를 격리한다
- 스키마 레지스트리와 계약 문서를 별도 관리해 생산자·소비자 버전 호환성을 통제한다.
온프레미스
브로커 클러스터를 이중화하고 디스크·네트워크·모니터링을 직접 운영한다; 배포는 표준 패키지나 오퍼레이터로 자동화한다; 백업·복구와 용량 계획을 수립한다; 내부 인증, TLS, ACL로 접근을 통제한다.
클라우드
관리형 큐·토픽·이벤트 버스를 사용하고 IaC로 토픽·구독·IAM·DLQ를 프로비저닝한다; 소비자는 오토스케일링이나 서버리스로 탄력 운영한다; 클라우드 모니터링·알람과 리텐션·비용 정책을 관리한다.
Kubernetes
Kafka나 브로커는 StatefulSet 또는 Operator로 배치한다; 소비자는 Deployment와 HPA로 확장한다; 네트워크 정책·시크릿·PVC·리소스 요청/제한을 설정한다; readiness/liveness와 PDB로 롤링 배포 안정성을 확보한다.
장애 대응
대표 장애 유형은 소비자 지연·적체, poison message, 브로커 자원 고갈, 네트워크 단절, 재시도 폭주다. 큐 깊이·컨슈머 랙·가장 오래된 메시지 나이를 확인하고, 실패 메시지는 DLQ에서 페이로드와 메타데이터를 조사해 데이터·코드·인프라 원인을 분류한다. 원인 수정 후 선별 재처리하고, 백프레셔·재시도 백오프·알람·용량을 조정해 재발을 막는다.
14개 관점별 근거
조사 당시 근거 보유 여부입니다. 출처의 정확성과 최신성을 별도로 판단하세요.
정의·개요근거 있음
소프트웨어 컴포넌트나 애플리케이션 간에 메시지를 교환하는 통신 방식이다.
Messaging is a method of communication between software components or applications.해결하는 문제근거 있음
애플리케이션 간 결합을 줄이고 오래 걸리거나 취약한 동기 프로세스를 제거하는 데 활용된다.
Message queuing allows for application decoupling so that we remove the need for long-running and brittle processes.주요 구성 컴포넌트·리소스근거 있음
프로듀서와 컨슈머가 직접 또는 중개 메시지 브로커를 통해 메시지를 교환한다.
The producer and the consumers can communicate directly or through an intermediary message broker entity.데이터·에셋 배치 원칙근거 있음
메시지는 애플리케이션 데이터를 페이로드로 담고 선택적 속성·메타데이터를 부가하며 메시징 서버가 임시 보관한다.
A message typically contains the payload — whatever information your application sends: XML, JSON, binary data, and so on.대표 유스케이스근거 있음
토픽 기반 게시·구독으로 이벤트나 메시지를 다수 소비자에게 전파할 때 적합하다.
The Pub-Sub pattern is one in which a publisher sends a message to a topic on a message broker.시나리오 예시근거 있음
주문 접수 앱이 메시지를 큐에 적재한 뒤 즉시 다음 주문을 처리하고, 소비자는 후속 처리를 비동기로 수행하는 시나리오다.
Once a message is sent, it is stored safely on a queue ... The sending application can move forward and continue to process other orders.부적합 상황·주의근거 있음
소비 지연으로 메시지가 적체되면 브로커 자원 고갈과 전체 장애 확산이 발생할 수 있어 주의해야 한다.
The messages back up, eventually consuming all resources on the RabbitMQ server, causing it to fall over.온프레미스 관점(개발·배포·운영)근거 있음
이벤트 메시징 플랫폼은 고객의 온프레미스 Kubernetes 클러스터에도 설치해 운영할 수 있다.
Advanced event mesh can be installed in a customer's on-premises or cloud-based Kubernetes cluster.클라우드 관점(개발·배포·운영)근거 있음
클라우드 메시징은 포인트투포인트 요청, 메시지 큐, 구독 토픽, 이벤트 버스 등 다양한 전송 채널을 활용한다.
Producers and consumers exchange messages using a variety of transportation channels, for example point-to-point requests, message queuesKubernetes 관점(개발·배포·운영)근거 있음
Kafka 같은 메시징 플랫폼은 Strimzi를 통해 Kubernetes 클러스터에서 운영할 수 있다.
Strimzi simplifies the process of running Apache Kafka in a Kubernetes cluster.장애 대응 관점근거 있음
DLQ 알림이 발생하면 메시지 페이로드와 실패 메타데이터를 확인하는 것부터 복구 절차를 시작한다.
When the DLQ alert fires, the recovery process is: 1. Inspect the message. Read the payload and failure metadata.장점근거 있음
분산 컴포넌트 간 통신을 느슨하게 결합할 수 있다.
Messaging enables distributed communication that is loosely coupled.단점·트레이드오프근거 있음
메시징 기반 시스템은 본질적으로 분산 시스템이므로 다양하고 감지하기 어려운 장애가 발생할 수 있다.
Messaging-based systems are distributed by definition and can fail in different, and sometimes subtle, ways.대표 기술·도구근거 있음
대표 기술로 Apache Kafka가 있으며, Kubernetes 배포에는 Strimzi 같은 운영 도구를 사용할 수 있다.
Message Bus uses Apache Kafka in its platform to support the event store and stream-processing and for packaging.추가 참고 문헌 (24)
- Pattern: Messaging ↗
- Introduction to Messaging for Modern Cloud Architecture | AWS Architecture Blog ↗
- Asynchronous Messaging Options - Azure Architecture Center | Microsoft Learn ↗
- Architectural messaging patterns: an illustrated guide ↗
- Jakarta Messaging Concepts :: Jakarta EE Tutorial :: Jakarta EE Documentation ↗
- What is Messaging? ↗
- Interservice communication in microservices - Azure Architecture Center | Microsoft Learn ↗
- Building Scalable Applications and Microservices: Adding Messaging to Your Toolbox | AWS Compute Blog ↗
- Messaging Connectivity in a Hybrid Kubernetes Cloud Environment ↗
- Deploy Mattermost on Kubernetes | Mattermost Documentation ↗
- Deployment Architecture for Kubernetes ↗
- Chatwork Uses Amazon EKS to Increase Operational Efficiency, Support Over 6.5 Billion Messages ↗
- Deploy for Out-of-Band (OOB) Communications | Mattermost Documentation ↗
- The need for Kubernetes Native Messaging Platform in Hybrid Cloud Environment ↗
- Deploying Unified Operations Message Bus ↗
- Kubernetes Message Queue | CNCF ↗
- Retries, dead letter queues and poison messages | System Design | Cloudmash Learn ↗
- Guidance for Asynchronous Messaging - Canada.ca ↗
- Understanding Failure Modes in Message and Event-based Systems | Stitch Fix Technology – Multithreaded ↗
- How Message-Passing Systems Handle Backpressure and Overloaded Consumers ↗
- Reliability Guide | RabbitMQ ↗
- Recommendations for handling transient faults - Microsoft Azure Well-Architected Framework | Microsoft Learn ↗
- Error Handling Patterns | KubeMQ Developer Center ↗
- BEE-10005: Dead Letter Queues and Poison Messages | Backend Engineering Essentials ↗