Class QueryBasedSubscriptionRecoveryPolicy
- java.lang.Object
-
- org.apache.activemq.broker.region.policy.QueryBasedSubscriptionRecoveryPolicy
-
- All Implemented Interfaces:
SubscriptionRecoveryPolicy,Service
public class QueryBasedSubscriptionRecoveryPolicy extends Object implements SubscriptionRecoveryPolicy
This implementation ofSubscriptionRecoveryPolicywill perform a user specific query mechanism to load any messages they may have missed.
-
-
Constructor Summary
Constructors Constructor Description QueryBasedSubscriptionRecoveryPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(ConnectionContext context, MessageReference message)A message was sent to the destination.Message[]browse(ActiveMQDestination dest)protected voidconfigure(ActiveMQMessage msg)SubscriptionRecoveryPolicycopy()Used to copy the policy object.protected ProducerIdcreateProducerId()protected voiddispatchInitialMessage(Message message, Destination regionDestination, ConnectionContext context, SubscriptionRecovery sub)MessageQuerygetQuery()voidrecover(ConnectionContext context, Topic topic, SubscriptionRecovery sub)Let a subscription recover message held by the policy.voidsetBroker(Broker broker)voidsetQuery(MessageQuery query)Sets the query strategy to load initial messagesvoidstart()voidstop()
-
-
-
Method Detail
-
copy
public SubscriptionRecoveryPolicy copy()
Description copied from interface:SubscriptionRecoveryPolicyUsed to copy the policy object.- Specified by:
copyin interfaceSubscriptionRecoveryPolicy- Returns:
- the copy
-
add
public boolean add(ConnectionContext context, 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
public void start() throws Exception
-
getQuery
public MessageQuery getQuery()
-
setQuery
public void setQuery(MessageQuery query)
Sets the query strategy to load initial messages
-
browse
public Message[] browse(ActiveMQDestination dest) throws Exception
- Specified by:
browsein interfaceSubscriptionRecoveryPolicy- Returns:
- messages
- Throws:
Exception
-
setBroker
public void setBroker(Broker broker)
- Specified by:
setBrokerin interfaceSubscriptionRecoveryPolicy
-
dispatchInitialMessage
protected void dispatchInitialMessage(Message message, Destination regionDestination, ConnectionContext context, SubscriptionRecovery sub)
-
configure
protected void configure(ActiveMQMessage msg) throws JMSException
- Throws:
JMSException
-
createProducerId
protected ProducerId createProducerId()
-
-