2

I am trying to implement eventsourcing using Akka persisten actors. The receiver actors are persistent, they persist the message before processing them. I have a round-robin-pool of persistent receiver actors. Now since the persistent id is same for these pool of actors, how to handle recovery? Or i want to understand the correct way of using persistency with pool of actors...

I was thinking to use this propery 'akka.persistence.max-concurrent-recoveries = 1'.

NOTE: i am using java

karts
  • 151
  • 3
  • 12

1 Answers1

2

According to docs:

Note persistenceId must be unique to a given entity in the journal (database table/keyspace). When replaying messages persisted to the journal, you query messages with a persistenceId. So, if two different entities share the same persistenceId, message-replaying behavior is corrupted.

Seems that you need akka cluster-sharding with unique persistenceId for every entity actor.

Also see: Can I Read/Write from separate actors with same PersistenceId?

GoodPerson
  • 141
  • 2
  • 6
  • Thanks. I went through the doc earlier and then I had this doubt. By the way, I do not want to use cluster-sharding, I want to scale the actors with in the same JVM. I think the correct way is to remove persistency on the receiver actos. – karts Aug 21 '19 at 14:09