alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Akka/Scala example source code file (AsyncRecoveryPlugin.java)

This example Akka source code file (AsyncRecoveryPlugin.java) is included in my "Source Code Warehouse" project. The intent of this project is to help you more easily find Akka and Scala source code examples by using tags.

All credit for the original source code belongs to akka.io; I'm just trying to make examples easier to find. (For my Scala work, see my Scala examples and tutorials.)

Akka tags/keywords

akka, asyncrecoveryplugin, concurrent, future, japi, journal, persistence, procedure

The AsyncRecoveryPlugin.java Akka example source code

/**
 * Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
 */

package akka.persistence.journal.japi;

import scala.concurrent.Future;

import akka.japi.Procedure;
import akka.persistence.PersistentRepr;

interface AsyncRecoveryPlugin {
    //#async-replay-plugin-api
    /**
     * Java API, Plugin API: asynchronously replays persistent messages.
     * Implementations replay a message by calling `replayCallback`. The returned
     * future must be completed when all messages (matching the sequence number
     * bounds) have been replayed. The future must be completed with a failure if
     * any of the persistent messages could not be replayed.
     *
     * The `replayCallback` must also be called with messages that have been marked
     * as deleted. In this case a replayed message's `deleted` method must return
     * `true`.
     *
     * The channel ids of delivery confirmations that are available for a replayed
     * message must be contained in that message's `confirms` sequence.
     *
     * @param persistenceId processor id.
     * @param fromSequenceNr sequence number where replay should start (inclusive).
     * @param toSequenceNr sequence number where replay should end (inclusive).
     * @param max maximum number of messages to be replayed.
     * @param replayCallback called to replay a single message. Can be called from any
     *                       thread.
     */
    Future<Void> doAsyncReplayMessages(String persistenceId, long fromSequenceNr, long toSequenceNr, long max, Procedure<PersistentRepr> replayCallback);

    /**
     * Java API, Plugin API: asynchronously reads the highest stored sequence number
     * for the given `persistenceId`.
     *
     * @param persistenceId processor id.
     * @param fromSequenceNr hint where to start searching for the highest sequence
     *                       number.
     */
    Future<Long> doAsyncReadHighestSequenceNr(String persistenceId, long fromSequenceNr);
    //#async-replay-plugin-api
}

Other Akka source code examples

Here is a short list of links related to this Akka AsyncRecoveryPlugin.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.