Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Akka PersistenActor with RoundRobinPool

Tags:

akka

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

like image 326
karts Avatar asked Nov 25 '25 04:11

karts


1 Answers

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?

like image 91
GoodPerson Avatar answered Nov 28 '25 17:11

GoodPerson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!