/** * Replays the referenceStore first as those messages are the oldest ones, then messages are replayed from the * transaction log and then the cache is updated. * * @param listener * @throws Exception */ public void recover(final MessageRecoveryListener listener) throws Exception { flush(); referenceStore.recover(new RecoveryListenerAdapter(this, listener)); }
public void recoverSubscription(String clientId, String subscriptionName, MessageRecoveryListener listener) throws Exception { flush(); topicReferenceStore.recoverSubscription(clientId, subscriptionName, new RecoveryListenerAdapter(this, listener)); }
public void recoverNextMessages(String clientId, String subscriptionName, int maxReturned, final MessageRecoveryListener listener) throws Exception { RecoveryListenerAdapter recoveryListener = new RecoveryListenerAdapter(this, listener); topicReferenceStore.recoverNextMessages(clientId, subscriptionName,maxReturned, recoveryListener); if (recoveryListener.size() == 0) { flush(); topicReferenceStore.recoverNextMessages(clientId,subscriptionName, maxReturned, recoveryListener); } }
public void recoverNextMessages(int maxReturned, MessageRecoveryListener listener) throws Exception { RecoveryListenerAdapter recoveryListener = new RecoveryListenerAdapter(this, listener); referenceStore.recoverNextMessages(maxReturned, recoveryListener); if (recoveryListener.size() == 0 && recoveryListener.hasSpace()) { flush(); referenceStore.recoverNextMessages(maxReturned, recoveryListener); } }