Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Related to Pub/Sub Model  RSS feed

 
Shrinivas Mujumdar
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends,
Can anybody tell me about the difference between persistent & durable messages related to Pub/Sub Model.
Some books & site atrticles talk about "Persistent Publisher & Durable Subscriber" what exactly this stuff is?
Can I send persistent messages using TopicPublisher? & what will be its use?


don't mind for too many questions

Thanks in Advance
Shrinivas
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I'm not sure which of those terms covers exactly what, but sometimes you want a message to get to a subscriber whether they are currently present or not. You can put the message into a persistant queue (usually backed by a database) so it won't be lost if the subscriber is not running. Then when the subscriber starts up or comes into existence it can pull queued messages at its leisure. See Enterprise Integration Patterns (by Thoughtworker Gregor Hohpe) for much more on this kind of thing.
 
Shrinivas Mujumdar
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody help me related to this issue?

Shrinivas
 
Shrinivas Mujumdar
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,



No help yet!!!



Shrinivas
 
Lars Vonk
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Shrinivas,

You have 2 kinds of Pub/Sub models: Durable and non-durable.

The durable model is actually as Stan told you earlier:
You use persistent messages in combination with durable subscribers when you want your messages retained even when your message consumer is not connected. This means that your messages are 'saved' untill your consumer connects again.

Non-durable means that if you use non-durable subscribers and non-persistent messages then a message sent to a consumer that is not connected is 'lost' for that consumer.

Hope this helps,
Lars
 
Shrinivas Mujumdar
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello lars
Thanks for the help first of all. Question remains in my mind about one combination non-durable subscriber & Persistent messages.what will happen for this?


Regards
Shrinivas
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the Enterprise Integration Patterns site I mentioned before Durable Subscriber looks like persistent messaging is an implementation detail in building Durable Subscriptions.

There is a relationship we haven't hit yet, and I don't know if it has a name. Let's say the subscriber always exists - the first thing created at system startup and the last thing destroyed - but publishers come and go all day. Open a window, create a new publisher. Log on a user, create a new publisher. The vanilla Observer pattern doesn't handle this because the Observer needs a reference to the Observable so it can sign up for messages. Some intermediary is needed to manage subscriptions. This is an option that is barely mentioned in the GoF on Observer but JMS handles it as a natural part of life.
 
Lars Vonk
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, Stan is right. Persistent messages are indeed an implementation detail of durable subscribtions.

Lars
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!