You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by ivanrc <ir...@indra.es> on 2007/10/18 17:35:01 UTC

What is the function of destinationPolicy?

Hi,

 Is DestinationPolicy for durable or  Non-durable Consumers or both?

I have got this in my config file but neither
timedSubscriptionRecoveryPolicy  nor oldestMessageEvictionStrategy work. 

<destinationPolicy>
      <policyMap><policyEntries>
          <policyEntry topic=">">
          	<messageEvictionStrategy>
           		<oldestMessageEvictionStrategy/>
      		</messageEvictionStrategy>
            <dispatchPolicy>
              <strictOrderDispatchPolicy />
            </dispatchPolicy>
            <subscriptionRecoveryPolicy>
              <timedSubscriptionRecoveryPolicy recoverDuration="60000" />
            </subscriptionRecoveryPolicy>
            
          </policyEntry>
      </policyEntries></policyMap>
    </destinationPolicy>

I have a cluster with two brokers, and when non-durable customerĀ“s broker
fail, it loss messages during failover proccess (until reconnect to the
other brocker), and I think with timedSubscriptionRecoveryPolicy the
customer must recovered all lossed messages published during the failover
process (failover procces take less than 60 seconds).

With durable consumers, I stop the consumer, and restart it after 5 minutes.
I think that with timedSubscriptionRecoveryPolicy set in 60 seconds, I only
should recovered the last 60 seconds, but I recover all (all mensajes sended
since customer stop).

Thanks.
-- 
View this message in context: http://www.nabble.com/What-is-the-function-of-destinationPolicy--tf4647859s2354.html#a13277252
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: What is the function of destinationPolicy?

Posted by ivanrc <ir...@indra.es>.


James.Strachan wrote:
> 
> To attach different policies to destinations :)
> 
> On 18/10/2007, ivanrc <ir...@indra.es> wrote:
>>
>> Hi,
>>
>>  Is DestinationPolicy for durable or  Non-durable Consumers or both?
> 
> Is for destinations, not for consumers.
> 
> 
>> I have got this in my config file but neither
>> timedSubscriptionRecoveryPolicy  nor oldestMessageEvictionStrategy work.
> 
> How can you be sure?
> 
> e.g. recovery policy on topics only works for retroactive consumers -
> are you setting that flag on your consumer?
> http://activemq.apache.org/retroactive-consumer.html
> 
> and evictionStrategy stuff only works *after* the prefetch buffer is
> filled - so I'd recommend setting your prefetch low or using tons of
> messages if you're testing out your config.
> http://activemq.apache.org/what-is-the-prefetch-limit-for.html
> 
>>
>> <destinationPolicy>
>>       <policyMap><policyEntries>
>>           <policyEntry topic=">">
>>                 <messageEvictionStrategy>
>>                         <oldestMessageEvictionStrategy/>
>>                 </messageEvictionStrategy>
>>             <dispatchPolicy>
>>               <strictOrderDispatchPolicy />
>>             </dispatchPolicy>
>>             <subscriptionRecoveryPolicy>
>>               <timedSubscriptionRecoveryPolicy recoverDuration="60000" />
>>             </subscriptionRecoveryPolicy>
>>
>>           </policyEntry>
>>       </policyEntries></policyMap>
>>     </destinationPolicy>
>>
>> I have a cluster with two brokers
> 
> By cluster you mean master/slave right?
> 
>> With durable consumers, I stop the consumer, and restart it after 5
>> minutes.
>> I think that with timedSubscriptionRecoveryPolicy set in 60 seconds, I
>> only
>> should recovered the last 60 seconds, but I recover all (all mensajes
>> sended
>> since customer stop).
> 
> subscription recovery is only for non-durable consumers. For durable
> consumers they are kept forever; there is no timeout.
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source SOA
> http://open.iona.com
> 
> 


Thank you. I am not setting the consumer retroactive flag jeje.

-- 
View this message in context: http://www.nabble.com/What-is-the-function-of-destinationPolicy--tf4647859s2354.html#a13292367
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: What is the function of destinationPolicy?

Posted by James Strachan <ja...@gmail.com>.
To attach different policies to destinations :)

On 18/10/2007, ivanrc <ir...@indra.es> wrote:
>
> Hi,
>
>  Is DestinationPolicy for durable or  Non-durable Consumers or both?

Is for destinations, not for consumers.


> I have got this in my config file but neither
> timedSubscriptionRecoveryPolicy  nor oldestMessageEvictionStrategy work.

How can you be sure?

e.g. recovery policy on topics only works for retroactive consumers -
are you setting that flag on your consumer?
http://activemq.apache.org/retroactive-consumer.html

and evictionStrategy stuff only works *after* the prefetch buffer is
filled - so I'd recommend setting your prefetch low or using tons of
messages if you're testing out your config.
http://activemq.apache.org/what-is-the-prefetch-limit-for.html

>
> <destinationPolicy>
>       <policyMap><policyEntries>
>           <policyEntry topic=">">
>                 <messageEvictionStrategy>
>                         <oldestMessageEvictionStrategy/>
>                 </messageEvictionStrategy>
>             <dispatchPolicy>
>               <strictOrderDispatchPolicy />
>             </dispatchPolicy>
>             <subscriptionRecoveryPolicy>
>               <timedSubscriptionRecoveryPolicy recoverDuration="60000" />
>             </subscriptionRecoveryPolicy>
>
>           </policyEntry>
>       </policyEntries></policyMap>
>     </destinationPolicy>
>
> I have a cluster with two brokers

By cluster you mean master/slave right?

> With durable consumers, I stop the consumer, and restart it after 5 minutes.
> I think that with timedSubscriptionRecoveryPolicy set in 60 seconds, I only
> should recovered the last 60 seconds, but I recover all (all mensajes sended
> since customer stop).

subscription recovery is only for non-durable consumers. For durable
consumers they are kept forever; there is no timeout.

-- 
James
-------
http://macstrac.blogspot.com/

Open Source SOA
http://open.iona.com