[akka-user] Persistence plugin getting AtomicWrites with duplicate sequenceNr

2017-01-27 Thread Alan Burlison
I'm attempting to write a persistence plugin that saves in JSON format into flat files. I've got the basic write side working but I'm seeing records in the JSON file with duplicate sequenceNr values (PersistentRepr.sequenceNr). My test harness is creating two instances of the same PersistentAct

Re: [akka-user] Persistence plugin getting AtomicWrites with duplicate sequenceNr

2017-01-27 Thread Konrad Malawski
It is unsafe to have 2 writers at the same time in Akka Persistence. All tools around it, such as Cluster Sharding etc work towards ensuring that you always have the one single entity existing, and not two entities of the same identity. If you think about it as in modeling any domain, that is exac

Re: [akka-user] Persistence plugin getting AtomicWrites with duplicate sequenceNr

2017-01-27 Thread Alan Burlison
On 27/01/17 10:59, Konrad Malawski wrote: So the uniequeness is to be guarnateed on persistentId. The writerUID exists for noticing that things are going wrong / have gone wrong and restoring from such failures. It is wrong to write tests that have 2 writers and expect a consistent output "just

Re: [akka-user] Persistence plugin getting AtomicWrites with duplicate sequenceNr

2017-01-27 Thread Konrad Malawski
Not "ever", but "at the same time". This is exactly the single writer principle. Otherwise you would have to check the entire cluster before each write making sure that there wasn't a conflicting write ;) there's quite some theory behind this. As I mentioned, CRDTs take the oppsosite stance. Pleas

Re: [akka-user] Persistence plugin getting AtomicWrites with duplicate sequenceNr

2017-01-27 Thread Alan Burlison
On 27/01/17 11:36, Konrad Malawski wrote: Not "ever", but "at the same time". This is exactly the single writer principle. Otherwise you would have to check the entire cluster before each write making sure that there wasn't a conflicting write ;) there's quite some theory behind this. As I menti

Re: [akka-user] transactors and STM are gone. What conception to use instead?

2017-01-27 Thread scala solist
Thanks for the reply! I'm currently implemented some plain and simple observable variable model atop of normal actors. Actor could control immutable state, it accepts update messages that contains write lenses and applies them. It manages subscriptions to the changes where subscriber provide re

[akka-user] Akka Cluster and custom code deployment (transfer the classes to the nodes to start new actors at runtime)

2017-01-27 Thread Eugene Dzhurinsky
Hi! Is there any way to deploy the code (jar files) along with starting the new actors in the Akka cluster without the cluster restart? For example - I have some "base" actors tier that provides the core logic for the data flow. Now I want to create a solution, that will use these actors (usi