Hello! I am a new Akka user; having read the documentation, I am having difficulties understanding a few things, especially as they relate to my project. I have a few specific questions regarding the capabilities of Akka as it relates to our project goals, as well as a few general questions regarding Akka itself.
I am building out a Java-based system to handle events for user accounts. We are consuming Avro-encoded messages from a Kafka queue, and these messages are of different types (each message type uses a different Avro schema). We do various tasks, largely Database-based with the contents of each message. The consistent hashing router seems ideal for our needs as each hash would map to an individual actor. Currently, our thinking is as follows: * We look up the proper Avro schema to decode the message, then deserialize it into the correct type. * We implement an Actor dedicated to handling each message type. That is, there would be a 1-1 correspondence between Avro message types and Akka Actor types. * Each message, regardless of event type has a user's unique and consistent user ID associated with it (intuitively, this means that each message for a given user would hash identically). * The most important point: we need to handle messages for a given user SERIALLY; these are events for a user account and are strictly ordered. Messages for different users, however, we may handled in parallel. Our primary concern with this project is that race conditions don't exist between a single user's messages. The rub comes when I try to figure out the best way to implement this idea. Namely, I haven't been able to find or figure out: 1. Whether or not a single Consistent Hashing Router can handle this. Can we have a single router that can have instances of heterogeneous actors that handle each message type? 2. If 1. DOES hold, are we still guaranteed that each user's messages will be handled serially? (example: an instance of message type X comes off the queue, then and instance of message type Y; both would be events for the same user's account, so they would have the same hash value. Would message X still complete processing before message Y? That is, does the consistent hash mapper block on the calculated hash, or on the availability of an actor that handles a specific type with that hash? In terms of general questions: 1. The documentation is quite fuzzy when it comes to Dispatchers vs. Routers. On occasion, the documentation seems to imply that a Router can replace a dispatcher completely, whereas in other places the documentation describes configuring a dispatcher for a specific router. this makes it difficult for me to understand when this actually needs to happen (in particular, the Consistent Hashing router documentation in particular omits explicit mention of a dispatcher). Is a dispatcher necessary or configurable with the Consistent Hashing router? 2. I am unclear as to the role of Mailboxes in this scheme. With the consistent hash router, is it one mailbox per calculated hash, or one mailbox per calculated hash per type (that is, for a calculated hash of "abc123" and messages of type X and Y, do the actors that handle type X and Y have their own mailboxes? 3. I read the following Slideshare: http://www.slideshare.net/shinolajla/effective-actors-jaxconf2012-14472247 and it seems to indicate that Actors should be non-blocking. Unfortunately, I haven't been able to find examples of "proper" actor implementation in a language other than Scala. Is there a way to implement database reads/writes that are serial for a given user *without* a blocking actor? Thank you for your patience and any help that anyone could offer in helping me puzzle through these issues. -- >>>>>>>>>> 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
