From messaging point of view with systems like Kafka, RabbitMQ, HornetQ, ActiveMQ, etc. is there a difference between pub/sub and prod/con or are they used interchangeably?
Publiser and Subscriber then? Yes, Publisher/Subscriber and Producer/Consumer are used interchangeably but not Pub/Sub and Producer/Consumer. Publisher/Subscriber is specifically used in Pub/Sub messaging pattern and Producer/Consumer in P2P messaging pattern.
Publish/Subscribe (Pub/Sub) messaging provides instant event notifications for these distributed applications. The Publish Subscribe model allows messages to be broadcast to different parts of a system asynchronously.
In a message-queue model, the publisher pushes messages to a queue where each subscriber can listen to a particular queue. In the event-stream model using Pub/Sub, the publisher pushes messages to a topic that multiple subscribers can listen to.
The Pub Sub queue (or Pub/Sub) is a message pattern of message brokers and it is used to communicate between the various components of microservices. It is used to provide program-to-program and asynchronous communication between the micro-services.
There is a difference between the publish/subscribe and producer/consumer models.
Publish/Subscribe : Subscribers subscribe to the publisher. Each message the Publisher publishes is sent to all the subscribers. That is, all subscribers receive the same message. (Think of a newspaper or magazine subscription. All subscribers receive the same magazine or newspaper)
Producer/Consumer : Each message the producer produces will be consumed by a single consumer. This is a mechanism to distribute the work load to multiple consumers. (Think of the several cash registers at the supermarket. Each customer goes to a single cash register. The customers are like the messages that are produced and the cash registers are the consumers)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With