Publish / Subscribe vs Producer / Consumer?

In terms of messaging with systems like kafka, rabbit, hornet mq, activemq, etc. Is there a difference between pub / sub and prod / con or are they used interchangeably?

+10
source share
3 answers

Although the terms Publish / Subscribe and Producer / Consumer refer to messaging, they are different and cannot be used interchangeably.

A publication / subscription is a messaging template in which a publication is distributed to multiple recipients. The producer is the sender of the messages, and the consumer is the recipient of the messages. Manufacturers and consumers are an integral part of publish / subscribe and point-to-point messaging templates.

Hope this helps.

+8
source

As I understand it - Prod / Consu - Producer produces, and Consumer consumes the produced task. - Publisher / Subscriber - The Publisher creates, and the Subscriber uses the created task only if the Subscriber is subscribed to the Publisher.

Both can be used interchangeably, but the latter makes sense in terms of architectural real-world use cases. Produce and publish only if you have signed a subscription agreement.

thanks

+1
source

Producer A consumer is basically a problem, because a producer produces something, and a consumer consumes it, but as a consumer should consume, this is a problem. Thus, a publisher-subscriber is an architecture or template to solve this problem.

0
source

Source: https://habr.com/ru/post/1264755/


All Articles