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); } }
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); } }
/** * 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 boolean recoverMessageReference(MessageId ref) throws Exception { Message message = this.store.getMessage(ref); if (message != null) { return recoverMessage(message); } else { throw new IllegalStateException("Message id " + ref + " could not be recovered from the data store for: " + store.getDestination().getQualifiedName() + " - already dispatched"); } }
public void recoverSubscription(String clientId, String subscriptionName, MessageRecoveryListener listener) throws Exception { flush(); topicReferenceStore.recoverSubscription(clientId, subscriptionName, new RecoveryListenerAdapter(this, listener)); }