Consider an actor ‘BankAccount’ which receives messages:
Within the actor, I only keep the balance as part of the state. The branchName (which is the branch of the bank) and time (time when the request was made) does not affect the actor’s state since it does not affect the balance.
I want to save all Deposit and Withdraw transactions to a SQL database — the amount, branchName, time as well as whether or not the transaction was successful or not. (Withdraw may fail if there’s not enough balance.) I do not need to save GetBalance requests.
Every end of day, I want to save the user’s balance to a different table on the same SQL database.
Given this, is it a proper fit for akka persistence? I’m thinking I can do event sourcing. I will need to write a custom journal and snapshot plugin however since I want it to write to a SQL database with a predefined schema. The journal and snapshot plugins however are not generic — that is, they can only handle specific messages / state — in this case Deposit and Withdraw messages and balance as a state. Is this acceptable?
Jan Vincent Liwanag
--
Jan Vincent Liwanag
>>>>>>>>>> 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 akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
Patrik Nordwall
Typesafe - Reactive apps on the JVM
Twitter: @patriknw
Is it "normal" to create a custom journal and snapshot mechanism for prespecified messages? Or should journal and snapshot implementations be generic -- that is, they should be able to handle any type of message and state - much like the default leveldb one?
--
>>>>>>>>>> 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 akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "Akka User List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/akka-user/yg3_Hapvli0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to akka-user+...@googlegroups.com.
Oh. I see. It would've been nice if I can choose the persistence plug in per actor type.I've read up on Views but don't exactly understand what they are for.
Is it better to have the view to log the messages into sql than to have the processor do it?