Query Plugin

It implements the following Persistence Queries:

  • eventsByPersistenceId, currentEventsByPersistenceId
  • eventsByTag, currentEventsByTag
  • persistenceIds, currentPersistenceIds

Accessing the PersistenceQuery for spanner:

Java
import akka.persistence.query.PersistenceQuery;
import akka.persistence.spanner.javadsl.SpannerReadJournal;

SpannerReadJournal queries = PersistenceQuery.get(system).getReadJournalFor(SpannerReadJournal.class, SpannerReadJournal.Identifier());
Scala
import akka.persistence.query.PersistenceQuery
import akka.persistence.spanner.scaladsl.SpannerReadJournal

val queries = PersistenceQuery(system).readJournalFor[SpannerReadJournal](SpannerReadJournal.Identifier)

Configuration

Query configuration is under akka.persistence.spanner.query. Here’s the default configuration values for the query plugin:

query {
  class = "akka.persistence.spanner.SpannerReadJournalProvider"

  # When live queries return no results. How often to poll Spanner for new
  # rows
  refresh-interval = 3s
}

The query plugin shares the same gRPC client and session pool as the rest of the plugin. See tuning the session pool for configuration.

Found an error in this documentation? The source code for this page can be found here. Please feel free to edit and contribute a pull request.