Publish/Subscribe vs Producer/Consumer?

user432024 picture user432024 · Feb 26, 2017 · Viewed 9.7k times · Source

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

Answer

Shashi picture Shashi · Feb 27, 2017

Although both Publish/Subscribe and Producer/Consumer terms are related to messaging, they are different and can't be used interchangeably.

Publish/Subscribe is a messaging pattern where a publication is distributed to multiple receivers. A Producer is the sender of messages and consumer is the receiver of messages. Producers and consumers are an integral part of both Publish/Subscribe and Point-to-Point messaging patterns.

Hope this helps.