You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Rob DellaFortuna <ro...@gmail.com> on 2006/07/18 22:43:02 UTC

Making sense of durability/reliability for topic subscriptions.

Hi Guys,

I was wondering if one of you ActiveMQ experts could answer a few of my
questions regarding some implementation questions I have.

One of the scenario/use-cases I wish to accomplish is this:
Note: I've simplified this to example to one consumer/producer, but really
the scenario will be one producer to multiple consumers of the provider's
topic.

 Say we have a provider 'p' drop in durable message into a topic 'T' and
have consumer 'c' subscribe to messages from 'p's topic T in such a manner
that
i) if a connection is lost between c and p, p will actually hold on to those
messages (for a set amount of time)
ii) when c reconnects to p, p will receive those messages that it has missed
and continue to receive future messages.
iii) when a connection fails between p/c, c will try to reconnect to p
(reliability?) and then try to accomplish retroactive/durable consuming (see
i/ii)

 So, in English, the consumer wishes to receive all messages published to
the topic, reconnect on failure, and receive all messages that were held on
for him due to a connection failure.

 So my first question is such that.

1. Is this possible to accomplish this above use-case?  My first guess is
that it should be. I've read a lot of the posts, and it seems I have two
options. Please correct me if I'm wrong:
  a) Option #1 for durability - Set the clientId and SubscriptionName when
making a broker connection from the Consumer to the provider's Topic. This
should make a topic 'durable'. (This should allow the consumer to receive
past messages it missed during a connection outing after reconnect.)

  b) Option #2 for durability - Use the jms.useRetroactiveConsumer in the
connection broker URI. (This should allow the consumer to receive past
messages it missed during a connection outing after reconnect.).  This seems
to work sometimes, but not always.

  c) Option #1 for Reliability – Use the failover: prefix when configuring
the connectionFactory's broker URI.

My second question is :

Is it possible to setup both durability and reliability for a consumer
subscribing to a topic by setting params or prefixes within the connection
URI passed to the connectionFactory?  I ask this since I'm currently setting
up the brokerURI via my servicemix config and it would be ideal to setup the
durability/reliability details within the connection URI.
BTW, I'm currently utilizing ServiceMix 3, with ActiveMQ 4.x if that makes a
difference.

I hope someone can make sense of these questions,

Thanks!

 Rob