Class TimedSubscriptionRecoveryPolicy
java.lang.Object
org.apache.activemq.broker.region.policy.TimedSubscriptionRecoveryPolicy
- All Implemented Interfaces:
SubscriptionRecoveryPolicy,org.apache.activemq.Service
This implementation of
SubscriptionRecoveryPolicy will keep a timed
buffer of messages around in memory and use that to recover new
subscriptions.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(ConnectionContext context, org.apache.activemq.broker.region.MessageReference message) A message was sent to the destination.org.apache.activemq.command.Message[]browse(org.apache.activemq.command.ActiveMQDestination destination) copy()Used to copy the policy object.voidgc()longvoidrecover(ConnectionContext context, Topic topic, SubscriptionRecovery sub) Let a subscription recover message held by the policy.voidvoidsetRecoverDuration(long recoverDuration) voidstart()voidstop()
-
Constructor Details
-
TimedSubscriptionRecoveryPolicy
public TimedSubscriptionRecoveryPolicy()
-
-
Method Details
-
copy
Description copied from interface:SubscriptionRecoveryPolicyUsed to copy the policy object.- Specified by:
copyin interfaceSubscriptionRecoveryPolicy- Returns:
- the copy
-
add
public boolean add(ConnectionContext context, org.apache.activemq.broker.region.MessageReference message) throws Exception Description copied from interface:SubscriptionRecoveryPolicyA message was sent to the destination.- Specified by:
addin interfaceSubscriptionRecoveryPolicy- Returns:
- true if successful
- Throws:
Exception
-
recover
public void recover(ConnectionContext context, Topic topic, SubscriptionRecovery sub) throws Exception Description copied from interface:SubscriptionRecoveryPolicyLet a subscription recover message held by the policy.- Specified by:
recoverin interfaceSubscriptionRecoveryPolicy- Throws:
Exception
-
setBroker
- Specified by:
setBrokerin interfaceSubscriptionRecoveryPolicy
-
start
- Specified by:
startin interfaceorg.apache.activemq.Service- Throws:
Exception
-
stop
- Specified by:
stopin interfaceorg.apache.activemq.Service- Throws:
Exception
-
gc
public void gc() -
getRecoverDuration
public long getRecoverDuration() -
setRecoverDuration
public void setRecoverDuration(long recoverDuration) -
browse
public org.apache.activemq.command.Message[] browse(org.apache.activemq.command.ActiveMQDestination destination) throws Exception - Specified by:
browsein interfaceSubscriptionRecoveryPolicy- Returns:
- messages
- Throws:
Exception
-