Prakhyat, I use something like the following code, (greatly simplied), for 
starting a view from a specific sequence number:

package demo

import scala.concurrent.duration._
import akka.actor.{ActorLogging, ActorRef, Props}
import akka.persistence.PersistentView

object CatchUp {

  case class Settings(    fromSeqNr: Long = 1L,     maxBufferSize: Int = 100, 

    idle: Option[FiniteDuration]) {

    require(fromSeqNr > 0L, "fromSeqNr must be > 0")
    require(maxBufferSize > 0, "maxBufferSize must be > 0")
  }
}
trait CatchUp extends PersistentView with ActorLogging {
  import CatchUp._
  def settings: Settings
  def receive: Receive = ???

  override def lastSequenceNr: Long =
    math.max(settings.fromSequenceNr - 1L, super.lastSequenceNr)

  override def autoUpdateInterval: FiniteDuration =
    settings.idle.getOrElse(super.autoUpdateInterval)

  override def autoUpdateReplayMax: Long =
    settings.maxBufferSize
}

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to