# SPDX-License-Identifier: Apache-2.0

#######################################################
# Pekko Persistence Query Reference Configuration File #
#######################################################

# This is the reference config file that contains all the default settings.
# Make your edits in your application.conf in order to override these settings.

#//#query-leveldb
# Configuration for the LeveldbReadJournal
pekko.persistence.query.journal.leveldb {
  # Implementation class of the LevelDB ReadJournalProvider
  class = "org.apache.pekko.persistence.query.journal.leveldb.LeveldbReadJournalProvider"
  
  # Absolute path to the write journal plugin configuration entry that this 
  # query journal will connect to. That must be a LeveldbJournal or SharedLeveldbJournal.
  # If undefined (or "") it will connect to the default journal as specified by the
  # pekko.persistence.journal.plugin property.
  write-plugin = ""
  
  # The LevelDB write journal is notifying the query side as soon as things
  # are persisted, but for efficiency reasons the query side retrieves the events 
  # in batches that sometimes can be delayed up to the configured `refresh-interval`.
  refresh-interval = 3s
  
  # How many events to fetch in one query (replay) and keep buffered until they
  # are delivered downstreams.
  max-buffer-size = 100
}
#//#query-leveldb

pekko.actor {
  serializers {
    pekko-persistence-query = "org.apache.pekko.persistence.query.internal.QuerySerializer"
  }
  serialization-bindings {
    "org.apache.pekko.persistence.query.typed.EventEnvelope" = pekko-persistence-query
    "org.apache.pekko.persistence.query.Offset" = pekko-persistence-query
  }
  serialization-identifiers {
    "org.apache.pekko.persistence.query.internal.QuerySerializer" = 39
  }
}
