Skip to content

PubSub vs MessageQueue vs Request & Response โ€‹

NameSolveUse CaseExample
PubSubbroadcast one message to multiple listeners, and donโ€™t care about how the message gonna be dealt with
Message Queueasynchronous processingtask has unpredictable processing time and may used up server and network resourcesOrder at McDonalds
Request & Response
  • PubSub: donโ€™t care about whether message is properly processed. 1-M (Publisher, vs Subscriber)
  • Message Queue: care about message must be processed once and in right order. 1-1 (Producer vs Consumer)

image

Released under the MIT License.