This week's book giveaway is in the Python forum.
We're giving away four copies of Python Continuous Integration and Delivery and have Moritz Lenz on-line!
See this thread for details.
Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

how publisher/subscriber works  RSS feed

 
Ranch Hand
Posts: 1310
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In pub/sub model one messages delivered to all the subscribers. So i need to know how it happen internally? for example when publisher send a message to topic how it sends same message to all the subscribers?
does subscriber send same message multiple time or topic send same message multiple time to subscribers?
 
Marshal
Posts: 24178
54
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The subscriber doesn't send any messages. Probably you meant to ask about the publisher?

Anyway, what exactly is your concern? Whether the subscribers all get the same message or whether they each get a copy of the message? If you're writing subscriber code, all you need to write is code to receive a published message. Who sends the message, or whether some other subscriber gets the same message (or a copy of it) aren't things which you have to take into account.
 
sam liya
Ranch Hand
Posts: 1310
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to know when publisher send a one message , how all the subscribers get same message? since publisher send one message , one subscriber can consume it.
 
Paul Clapham
Marshal
Posts: 24178
54
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Obviously, then, they each get a copy of the same message.
 
Saloon Keeper
Posts: 2406
296
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

sam liya wrote:I need to know when publisher send a one message , how all the subscribers get same message? since publisher send one message , one subscriber can consume it.


The publisher send one message to the broker.  The broker then forwards a copy of the message to all subscribers the consumers (subscribers) subscribed to the associated topic.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!