Class QueryBasedSubscriptionRecoveryPolicy
java.lang.Object
org.apache.activemq.broker.region.policy.QueryBasedSubscriptionRecoveryPolicy
- All Implemented Interfaces:
SubscriptionRecoveryPolicy,org.apache.activemq.Service
public class QueryBasedSubscriptionRecoveryPolicy
extends Object
implements SubscriptionRecoveryPolicy
This implementation of
SubscriptionRecoveryPolicy will perform a user
specific query mechanism to load any messages they may have missed.-
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 dest) protected voidconfigure(org.apache.activemq.command.ActiveMQMessage msg) copy()Used to copy the policy object.protected org.apache.activemq.command.ProducerIdprotected voiddispatchInitialMessage(jakarta.jms.Message message, Destination regionDestination, ConnectionContext context, SubscriptionRecovery sub) getQuery()voidrecover(ConnectionContext context, Topic topic, SubscriptionRecovery sub) Let a subscription recover message held by the policy.voidvoidsetQuery(MessageQuery query) Sets the query strategy to load initial messagesvoidstart()voidstop()
-
Constructor Details
-
QueryBasedSubscriptionRecoveryPolicy
public QueryBasedSubscriptionRecoveryPolicy()
-
-
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
-
getQuery
-
setQuery
Sets the query strategy to load initial messages -
browse
public org.apache.activemq.command.Message[] browse(org.apache.activemq.command.ActiveMQDestination dest) throws Exception - Specified by:
browsein interfaceSubscriptionRecoveryPolicy- Returns:
- messages
- Throws:
Exception
-
setBroker
- Specified by:
setBrokerin interfaceSubscriptionRecoveryPolicy
-
dispatchInitialMessage
protected void dispatchInitialMessage(jakarta.jms.Message message, Destination regionDestination, ConnectionContext context, SubscriptionRecovery sub) -
configure
protected void configure(org.apache.activemq.command.ActiveMQMessage msg) throws jakarta.jms.JMSException - Throws:
jakarta.jms.JMSException
-
createProducerId
protected org.apache.activemq.command.ProducerId createProducerId()
-