RabbitMQ
-
Spring AMQP를 사용한 메시징개발 일지/Back-end 2021. 12. 2. 16:48
1. 개요 본 포스트에서는 Spring AMQP 프레임워크를 사용하여 AMQP릉 통한 메시지 기반 통신을 살펴보겠습니다. 2. 메시지 기반 통신 메시징(Messaging)은 애플리케이션 사이에 통신을 위한 기술입니다. 동기적인 요청/응답 기반 아키텍처 대신 비동기 메시지 전달에 의존합니다. 메시지 생산자(Producer)와 소비자(Consumer)는 메시지 브로커라고 하는 중간 메시징 계층에 의해 분리됩니다. 메시지 브로커는 메시지의 퍼시스턴트 스토리지, 메시지 필터링 및 메시지 변환과 같은 기능을 제공합니다. Java로 개발된 애플리케이션 간의 메시징은 일반적으로 JMS(Java Message Service) API가 사용됩니다. 서로 다른 벤더와 플랫폼 간의 상호 운용성을 위해, JMS 클라이언트와 ..
-
Pub-Sub vs. Message Queues개발 일지/Back-end 2021. 12. 2. 15:47
1. 개요 본 포스트에서는 "메시지 큐"와 "Pub/Sub"을 살펴보겠습니다. 이들은 2개 이상의 서비스가 서로 통신하기 위해 분산된 시스템에서 사용되는 일반적인 패턴입니다. 2. 메시지 큐 메시지 큐는 퍼블리싱 서비스와 큐를 거쳐 동신하는 여러 컨슈머 서비스로 구성됩니다. 이 통신은 전형적으로 단방향의 특징을 가집니다. 위 그림에서 퍼블리셔는 'n+1'번째 메시지를 큐에 넣고 있습니다. 그리고 n개의 메시지들이 이미 큐에 존재하고 있고 소비되기를 기다리고 있습니다. 우측에는 큐의 메시지를 기다리는 'A'와 'B' 2개의 consuming 서비스를 가지고 있죠. 다음 상황을 고려해 보겠습니다. 먼저, 퍼블리셔의 메시지가 큐의 마지막에 들어갔습니다. 다음으로, 우측을 살펴보겠습니다. 소비자 'A'가 메시지..