Class FixedSizedSubscriptionRecoveryPolicy
java.lang.Object
org.apache.activemq.broker.region.policy.FixedSizedSubscriptionRecoveryPolicy
- All Implemented Interfaces:
SubscriptionRecoveryPolicy,org.apache.activemq.Service
public class FixedSizedSubscriptionRecoveryPolicy
extends Object
implements SubscriptionRecoveryPolicy
This implementation of
SubscriptionRecoveryPolicy will keep a fixed
amount of memory available in RAM for message history which is evicted in
time order.-
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.protected MessageListintbooleanvoidrecover(ConnectionContext context, Topic topic, SubscriptionRecovery sub) Let a subscription recover message held by the policy.voidvoidsetBuffer(MessageList buffer) voidsetMaximumSize(int maximumSize) Sets the maximum amount of RAM in bytes that this buffer can hold in RAMvoidsetUseSharedBuffer(boolean useSharedBuffer) voidstart()voidstop()
-
Constructor Details
-
FixedSizedSubscriptionRecoveryPolicy
public FixedSizedSubscriptionRecoveryPolicy()
-
-
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
-
start
- Specified by:
startin interfaceorg.apache.activemq.Service- Throws:
Exception
-
stop
- Specified by:
stopin interfaceorg.apache.activemq.Service- Throws:
Exception
-
getBuffer
-
setBuffer
-
getMaximumSize
public int getMaximumSize() -
setMaximumSize
public void setMaximumSize(int maximumSize) Sets the maximum amount of RAM in bytes that this buffer can hold in RAM -
browse
public org.apache.activemq.command.Message[] browse(org.apache.activemq.command.ActiveMQDestination destination) throws Exception - Specified by:
browsein interfaceSubscriptionRecoveryPolicy- Returns:
- messages
- Throws:
Exception
-
setBroker
- Specified by:
setBrokerin interfaceSubscriptionRecoveryPolicy
-
createMessageList
-