akka.actor {

  serialization-identifiers."akka.persistence.typed.serialization.ReplicatedEventSourcingSerializer" = 40

  serializers.replicated-event-sourcing = "akka.persistence.typed.serialization.ReplicatedEventSourcingSerializer"

  serialization-bindings {
    "akka.persistence.typed.internal.VersionVector" = replicated-event-sourcing
    "akka.persistence.typed.crdt.Counter" = replicated-event-sourcing
    "akka.persistence.typed.crdt.Counter$Updated" = replicated-event-sourcing
    "akka.persistence.typed.crdt.ORSet" = replicated-event-sourcing
    "akka.persistence.typed.crdt.ORSet$DeltaOp" = replicated-event-sourcing
    "akka.persistence.typed.internal.ReplicatedEventMetadata" = replicated-event-sourcing
    "akka.persistence.typed.internal.ReplicatedSnapshotMetadata" = replicated-event-sourcing
    "akka.persistence.typed.internal.PublishedEventImpl" = replicated-event-sourcing
  }
}

akka.persistence.typed {

  # Persistent actors stash while recovering or persisting events,
  # this setting configures the default capacity of this stash.
  #
  # Stashing is always bounded to the size that is defined in this setting.
  # You can set it to large values, however "unbounded" buffering is not supported.
  # Negative or 0 values are not allowed.
  stash-capacity = 4096

  # Configure how to react when the event sourced stash overflows. This can happen in two scenarios:
  # when a event sourced actor is doing recovery, persisting or snapshotting and it gets more than
  # 'stash-capacity' commands, or if more than 'stash-capacity' commands are manually stashed with the
  # 'stash' effect.
  #
  # Possible options
  # - drop - the message is published as a akka.actor.typed.Dropped message on the event bus
  # - fail - an exception is thrown so that the actor is failed
  stash-overflow-strategy = "drop"

  # enables automatic DEBUG level logging of messages stashed automatically by an EventSourcedBehavior,
  # this may happen while it receives commands while it is recovering events or while it is persisting events
  log-stashing = off
}

akka.reliable-delivery {
  producer-controller {
    event-sourced-durable-queue {
      # Max duration for the exponential backoff for persist failures.
      restart-max-backoff = 10s

      # Snapshot after this number of events. See RetentionCriteria.
      snapshot-every = 1000

      # Number of snapshots to keep. See RetentionCriteria.
      keep-n-snapshots = 2

      # Delete events after snapshotting. See RetentionCriteria.
      delete-events = on

      # Cleanup entries that haven't be used for this duration.
      cleanup-unused-after = 3600s

      # The journal plugin to use, by default it will use the plugin configured by
      # `akka.persistence.journal.plugin`.
      journal-plugin-id = ""

      # The journal plugin to use, by default it will use the plugin configured by
      # `akka.persistence.snapshot-store.plugin`.
      snapshot-plugin-id = ""
    }
  }
}
