How can i achieve the replay of the events in readside datasource?

How can i replay the events in lagom from the start or any point ?Do you guys have working pseudo code or any heads up will do.

And how lagom handles transaction in case of failovers while writing to write side data source when there is a critical POST operation?

You specify the start, or the offset, of the stream when querying the WriteSide for events. You can find more information in the ReadSide documentation. You can always take a look at the Lagom Samples for further inspiration.

Not exactly sure what you mean with “handles transaction in case of failover”, so I am going to resort to a stock response. I’ll start by providing a brief explanation of how the entities handle the persistence.

Because it uses Event Sourcing for data persistence, Lagom employs the Single Writer Principle. Lagom guarantees that there will be a single instance of each Persistent Entity started in your cluster ensemble. Therefore, you can view every command sent to the entity as an atomic operation. First, it will ensure the command makes sense, in accordance with your business rules, and attempt to persist the relevant domain events. If persisting the events fails - for example, the database is inaccessible - a negative acknowledgment is automatically sent, which will fail the Future on the sender side with PersistentEntity.PersistException. The onus is on the “client” to resend that request.

Where it makes sense, you can rely on the Actor’s Supervision and Monitoring to automatically retry certain requests. You can find more in the Integrating with Akka documentation.