activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Samplonius <...@samplonius.org>
Subject Re: How to ensure reliability of publish/subscribe against occassional network hiccup?
Date Mon, 16 Jul 2007 06:53:14 GMT

----- "Naresh Bhatia" <NBhatia@sapient.com> wrote:
> I would like to use ActiveMQ in an application where subcribers must
> receive
> EVERY message published to their topic. If a subscriber looses a
> message,
> its state would be out-of-sync with the publisher - and that would be
> a bad
> thing! Note however, that there is no need to receive messages when
> the
> subscriber is down or inactive, in other words durability of messages
> is not
> required.

  I don't understand the distinction between, "subscriber can not lose a message" vs. "subscriber
can drop messages when it is disconnected".  Subscribers are only going to lose messages unless
they disconnect, or are disconnected.  So I think you want durable messages.


> 1) What is the best way to use ActiveMQ in this scenario to protect
> against
> occassional network hiccups? Is it enough to have a transacted session
> or a
> non-transacted session with AUTO_ACKNOWLEDGE or CLIENT_ACKNOWLEDGE?
> Does
> this guarantee the receipt of all messages?

  I suppose so, and persistent subscriptions probably.

> 2) How does publish-subscribe actually work? Does the publisher send
> a
> seperate message to each subscriber and receive an explicit
> acknowledgement
> from each or is the message sent out as a broadcast (multicast?) and
> then
> explicit acknowledgements coming in from each subscriber?

  Well, the publisher sends one message to the broker (ActiveMQ), and the broker distributes
to the subscribers.  Subscribers ack to the broker.  Normally, the publisher has no idea who
received the message, and in most applications, does not care.  If subscribers need reliable
messages, they have to ask for it.


> Thanks.
> Naresh
> -- 
> View this message in context:
> http://www.nabble.com/How-to-ensure-reliability-of-publish-subscribe-against-occassional-network-hiccup--tf4068985s2354.html#a11562991
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Tom

Mime
View raw message