DEV Community

Discussion on: Introduction to Asynchronous Processing and Message Queues

Collapse
 
_hs_ profile image
HS

Subscription Model doesn't necessarily have to maintain private consumer queue. Take a look at Apache Pulsar where you have shared consumers meaning cursor is kept on the message system side but there can be many consumers that share the responsibility of reading the messages. So queue is not necessarily "private" per consumer but rather per subscription so system can track which messages were delivered per subscription to avoid double message processing by two different consumers in the same subscription. Also Apache Pulsar keeps messages in a queue even if they are "topics" so that's another part which can differ based on messaging system. They do have partitioned topics as well non-partitioned so some features might differ on the type of the topic but never the less I wanted to point out that there is some space for differences between what is subscription model.

I would rather say you have only two types - pull and push. Then subscription model is different feature of these system and can be divided in certain categories and discussed regardless of the communication strategy. I usually assume that subscription means push model as subscribers get notified as messages come in rather then checking periodically but in some cases you might keep track of message status on messaging system yet not notify consumers but let them ask for next message in line or allow replying / seeking previous messages. Basically subscription model is big enough to be discussed on it's own in my opinion.