You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Keith Irwin <ke...@gmail.com> on 2008/04/08 07:10:44 UTC

brand new durable subscribers AFTER messages sent to durable topic

Folks--

If you start up various processes that use AMQ for messaging, but have
no control over the order of how the processes are started, how do you
make sure that durable subscribers which have not yet subscribed for
the first time get the messages sent to a durable topic by a
publisher?

For instance:

  Fresh, never-before-run AMQ starts up.

  Process A starts up, sends 1000 messages to Topic A.

  Process B (finally) starts, durably subscribes to Topic A.

As far as I can tell, Process B will not get those original 1000
messages much like I won't get a backlog of Time Magazines if I send
in a subscription today.

I've looked at the Retroactive Consumer page, and the Subscription
Recovery Policy page, but I'm just not sure if the above case is
covered.

Is this the solution?

  * in activemq.xml, set <fixedCountSubscriptionRecoveryPolicy
maximumSize="10000"/> (or use one of the other options as fits other
constraints on the system)?

  * when I create the topic, somehow add ?consumer.retroactive=true to
the topic name?

I use the old JMS way of creating topics: I'm not sure if that works
with this new ActiveMQTopic thing I've only seen just now. ;)

Anyway, are the assumptions above about correct for this particular use case?

Keith

Re: brand new durable subscribers AFTER messages sent to durable topic

Posted by Rob Davies <ra...@gmail.com>.
On 8 Apr 2008, at 06:10, Keith Irwin wrote:

> Folks--
>
> If you start up various processes that use AMQ for messaging, but have
> no control over the order of how the processes are started, how do you
> make sure that durable subscribers which have not yet subscribed for
> the first time get the messages sent to a durable topic by a
> publisher?
>
> For instance:
>
>  Fresh, never-before-run AMQ starts up.
>
>  Process A starts up, sends 1000 messages to Topic A.
>
>  Process B (finally) starts, durably subscribes to Topic A.
>
> As far as I can tell, Process B will not get those original 1000
> messages much like I won't get a backlog of Time Magazines if I send
> in a subscription today.
>
> I've looked at the Retroactive Consumer page, and the Subscription
> Recovery Policy page, but I'm just not sure if the above case is
> covered.
>
> Is this the solution?
>
>  * in activemq.xml, set <fixedCountSubscriptionRecoveryPolicy
> maximumSize="10000"/> (or use one of the other options as fits other
> constraints on the system)?
>
>  * when I create the topic, somehow add ?consumer.retroactive=true to
> the topic name?
>
> I use the old JMS way of creating topics: I'm not sure if that works
> with this new ActiveMQTopic thing I've only seen just now. ;)
>
> Anyway, are the assumptions above about correct for this particular  
> use case?
>
> Keith

Hi Keith,

sorry but your case is not covered - even with retroactive consumers  
(consumer needs to exist first). You can either ensure your durable  
subscribers exist before the processes start (use JMX for example) -  
or use virtual topics - see http://activemq.apache.org/virtual-destinations.html


cheers,

Rob

http://open.iona.com/ -Enterprise Open Integration
http://rajdavies.blogspot.com/